Django is a very popular open source web framework, based on the MVC pattern, emphasizing rapid development with many powerful third-party plugins that developers can use to quickly and easily develop their own websites. This article describes how to install Django under Windows systems.
Install Python
As a Python web framework, you need to install Python before you install Django, but different versions of Django are not the same for Python versions, so refer to the table below.
Django Version |
python version |
1.4 |
2.5, 2.6, 2.7 |
1.7, 1.8 |
2.7, 3.2, 3.3, 3.4 |
1.9 |
2.7, 3.4, 3.5 |
Install Python under Windows, you can download the Windows installation package on the official Python website: Python download link
You can refer to the article "How to install Python under Windows," which is not described here.
Uninstall the old version of Django
If you've ever python setup.py install
installed Django in the way you used to, you'll need to delete the Django directory in the Python site-packages directory.
In order to know the location of the directory, you can execute the following command in CMD (note that it is not in the execution environment of Python):
python"import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"
Download the Django Code
The latest version of Django Code is on GitHub, and you can get the latest version of Django with Git commands.
clone https://github.com/django/django.git
Or, download the Django package: Download link
If you need to use Django in a formal production environment, it is recommended that you choose a stable version of Django, such as Django 1.8.
Installing Django
Open cmd, enter the Django code directory (for example, CD django-x.y), execute the command
install
You can see the cmd window output a large string of installation information, patiently waiting for a while after the installation is over.
Verifying the installation
In order to verify that the installation was successful, you can verify it by entering the following command in the Python prompt.
>>> import django>>> print(django.get_version())1.8
You can see that the Django version number was correctly output and the installation was successful.
Reference
- How to get Django
- How to install Django
- Quick Install Guide
- Faq:installation
- How to install the Django on Windows
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Installing Django under Windows