Users Online

· Guests Online: 49

· Members Online: 0

· Total Members: 188
· Newest Member: meenachowdary055

Forum Threads

Newest Threads
No Threads created
Hottest Threads
No Threads created

Latest Articles

Articles Hierarchy

Django Tutorial

 

How to Install Django

How-to-Install-Django

Introduction to Install Django

Django is an open-source web framework that is based on the Python programming language. It is maintained by an independent organization called Django Software Foundation. The primary goal of Django is to provide ease to complex and data have driven websites. This framework is used to focus on reusability and plug-ability of components where less code and low coupling with the rapid development is given preference. To install Django, first, you need to install Python on your local machine. So installing python is also covered in this document.

Steps to Install Django

For installing the Django, it needs a stable and good internet connection.

Let us discuss the steps required to install Django:

Step 1: First, visit the official site of Python, which is given below as:

https://www.python.org/

Step 2: After landing to the above web page, click on the downloads button shown below as and select your operating system installed in your local system.

 installed in your local system

In my case, I have clicked on windows.

Step 3: It will redirect to another page where on the very top you will get the title Python Releases for Windows, and just below you will get the Latest python release which is shown below as:

Step 3

Click the very first link, which is Latest Python 3 Release-Python 3.7.2This is the latest version available now; for this time, you may get the higher version as well but always use the first link.

Note: If a user uses Windows XP or older windows like Vista, click on the second link, Latest Python 2 Release- Python 2.7.15.

Step 4: After clicking on the above link, it redirects to other pages where on the top it shows the latest version of the Python. Just scroll down you would get the title files under which multiple download options are available, as shown below:

Step 4

For Windows 64-bit system, select the first Windows x86-64 web-based Installer marked in red and click on that, whereas for 32-bit system, select the last red-marked Windows x86 web-based installer.

Step 5: It will take some time to download the file; when it gets complete, save that installer file. Then, please click on the installer file, but for this, one should have a stable and good internet connection.

Step 6: When you click on the downloaded file, it will start a setup launch. The first step is to select the checkbox and click to tick the “Add Python 3.7 to PATH”, which shows at very extreme below marked in red. Then click on the Install Now as shown below. If one doesn’t select the Add Python 3.7 to PATH, it has to call Python manually each time, and it will take lots of time, so please tick the checkbox.

Next, you can refer to the below-provided image:

How to Install Django

Step 7: When one clicks on the Install button, it will start a warning message “Do you want to make changes in your system” so please click on Yes. It shows for few systems, and for a few, it won’t; it depends upon the system.

Then Setup progress as installation will start and looks as below:

How to Install Django

Step 8: And when it is done then it shows “Setup was successful” shown below:

Setup was successful

Now click on the Close button.

Step 9: To check that Python installed successfully or not. Press Windows (Hold this button then) + R (button from keyboard), it will open the Run command. Type “cmd” and press on OK button.

Python installed

Step 10: It will open the command prompt.

Code:

Python --version

Output:

Step 10

If Python is successfully installed, then it shows the version; otherwise, it shows an error. In this case, it shows Python 3.7.2, so Python installed in my system successfully.

Step 11: Then check the current version of pip. Pip is used to install the other packages in the python environment.

Code:

pip --version

It will show the installed version of the pip as shown below:

Output:

Step 11

Step 12: Now we’re ready to install the Django because we have set up the environment to install Django. Please use the given URL to open other web pages for Django installation: https://docs.djangoproject.com/en/2.1/howto/windows/

set up the environment

Step 13: When the web page opens, scroll down a little bit and stop where it shows “Install virtualenv and virtualenvwrapper title”, shown just above. One needs to use three commands which are marked in red. First, one needs to install the virtualenv and virtualenvwrapper to provide the virtual dedicated environment for Django. Just below this title, there is code available to install the virtual wrapper.

Code:

pip install virtualenvwrapper-win

Step 14: Type Powershell in windows search bar, and it gives the result Windows Powershell on top then right-click on Windows Powershell and click Run as administrator shown as:

Step 14

Step 15: It will open the power shell and then type the code pip install virtualenvwrapper-win given in the 13th step it will take some time to install the virtual wrapper environment in windows.

Step 15

Virtual wrapper environment installed successfully.

Step 16: Then, create a virtual environment for a Django project. The code is available in URL: https://docs.djangoproject.com/en/2.1/howto/windows/

Type this code or copy the code from the webpage to the Windows Powershell, which is given as:

Code:

mkvirtualenv myproject

It will create a virtual environment and shown as:

Output:

Step 16

Step 17: Now activate the virtual environment. So copy the code from the given URL or from below and type in Windows Powershell.

Code:

workon myproject

Output:

Step 17

Now my virtual environment is ready for the installation of the Django.

Step 18: Now finally install the Django using the pip command as shown below:

Code:

pip install Django

Output:

pip install Django

It will take some time for installation, but before installation, makes sure that your virtual environment is ready, which is done in step 17.

Step 19: Now Django is installed successfully. To verify the Django installation, type the following code in Windows Powershell as given below:

Code:

django-admin --version

Output:

How to Install Django

If it shows the version of Django, it means Django is installed successfully if not then please check the previous step. Here it shows 2.1.7 which is now the latest Django version.

 

 

 

Comments

No Comments have been Posted.

Post Comment

Please Login to Post a Comment.

Ratings

Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Render time: 0.78 seconds
10,843,283 unique visits