Quick Contact

    Python Tutorial
    Python Panda Tutorial
    Python Selenium
    Python Flask Tutorial
    Python Django
    Interview Questions & Answers

    How to Install Django and Set Up a Virtual Environment in 6 Steps

    Steps to Install Django and Set Up a Virtual Environment

    Here, are the steps to install Django in your system.

    Step 1. Installing Python 3

    To run the Django Framework on your system you would need Python 3 installed on your system. You just have to download the package from the official website, www.python.org, according to your operating system.

    Keep in mind you have to install a Python 3 version, not the version 2, so just download the stable Python 3 version or the version which it recommends you when you hover the cursor on the downloads link from the website.

    While installing Python 3 don’t forget to tick the option “Add Python 3 to your path” when the installation prompt opens.

    For Windows PowerShell Users

    You can check that the Python version is on your system by typing this command in PowerShell:

    python –version

    pip –version

    Step 2. Installing Virtualenv

    Virtualenv is a Python package that lets you create different virtual environments for multiple projects requiring different versions of the software.

    Its main function is to isolate your project environment with the rest of the system so whatever you install inside this virtual environment will not affect the rest of your system.

    For Windows PowerShell Users

    In PowerShell type in this command:

    pip install virtualenv

    This will download and install virtualenv on your system globally and will then let you create or will give this message if it’s installed already.

    Step 3. Installing Django

    At last, we can install Django on our system, for that again we will have to just execute some commands on our system.

    We will be installing Django globally on your system, after completing this tutorial you may want to install different versions of it and that’s what virtual environment is for.

    For Windows PowerShell Users

    Type this in PowerShell window:

    pip install django

    This command will install Django’s latest stable version and we will be working on the same.

    Step 4. Installing a Python IDE

    This is also an important part of any development environment and you can choose whichever IDE you are familiar with (for Python), for this tutorial I will be using the IDLE and PyCharm.

    The IDLE comes installed by default when you install Python in your system and if you want you can also install PyCharm or any other text editor.

    Step 5. Installing Xampp

    We will be using databases to make our websites more interactive and functional. The default database in Django is SQLite and we will be using SQL through our project.

    You can use any database you are familiar with, Django has connectivity with mostly all of them and you can very easily find the codes for that, this Xampp application will provide us much more interactive SQL experience via phpmyadmin and

    thus, will help beginners to utilize the database functionalities with ease.

    Step 6. Setting Up a Virtual Environment

    All the necessary requirements have been fulfilled and now we can start our project.

    Our first step will be to set up a virtual environment for our project.

    For Windows PowerShell Users

    To make a virtual environment, go to the directory of your choice via PowerShell and execute this command:


    This command will create a directory in the desired location with the name you have given, where it will copy all the default versions and libraries and packages of Python by default and then you can choose whether you want to use those same libraries or change them,

    in our case we don’t require any of that now.




    Apply now for Advanced Python Training Course

    Copyright 1999- Ducat Creative, All rights reserved.

    Anda bisa mendapatkan server slot online resmi dan terpercaya tentu saja di sini. Sebagai salah satu provider yang menyediakan banyak pilihan permainan.