Install Django in Windows and Django in Windows

Source: Internet
Author: User
Tags install django pip install django

Install Django in Windows and Django in Windows


Django is a very popular open-source web framework. Based on the MVC model, it emphasizes rapid development and has many powerful third-party plug-ins, developers can use these plug-ins to quickly and conveniently develop their own websites. This article describes how to install Django in Windows.

Install Python

As a Python web framework, you must install Python before installing django. However, different versions of django have different requirements for Python versions. For details, see the following table.

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 in Windows. You can download the Windows installation package from the official Python Website: Python download link.
For more information, see how to install Python in Windows.

Install Setuptools

To install the Python extension package, you must first install setuptools. For Windows, you can download ez_setup.py and run it using the Python command.

python ez_setup.py

For details about how to install setuptools, refer to setuptools or Baidu experience. [Python] how to install easy_install?

Install PIP

PIP is a Python Package management tool that uses Python Package Index to install Python packages.
First download the latest pip installation package, download page: https://pypi.python.org/pypi/pip#downloads
Decompress the package, enter the directory, and run:

python setup.py install

To install pip.
Or run the esay_install command to install pip:

easy_install pip
Uninstall the old version of Django

If you have usedpython setup.py installAfter installing djangoSite-packagesDelete the django directory under the directory.
To know the location of the Directory, run the following command in cmd (note that it is not in the Python execution environment ):

python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"
Download Django code

The latest version of django code is put on GitHub. You can use the git command to obtain the latest version of django.

git clone https://github.com/django/django.git

Alternatively, download the django compressed package: Download link
If you need to use django in a formal production environment, we recommend that you select a stable version of django, such as django 1.8.

Install Django

Open cmd, enter the django code directory (for example, cd Django-X.Y), execute the command

python setup.py install

The cmd window displays a large set of installation information. wait patiently and the installation is complete.
If you use pip to install django, run the following command:

pip install django
Verify Installation

To verify whether the installation is successful, enter the following command at the Python prompt to verify the installation.

>>> import django>>> print(django.get_version())1.8

You can see that the django version is correctly output and the installation is successful.

Reference

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.