Python and Django installation in Window environment, Project Creation, pythondjango

Source: Internet
Author: User

Python and Django installation in Window environment, Project Creation, pythondjango

1. First, we need to download python and Django.

Python: https://www.python.org/

Django address: https://www.djangoproject.com/

 

2. Install the python environment before installing Django.

A. After downloading the python installation package, click next)

B. Configure python Environment Variables

C. Test whether python is successfully installed. Open the command line in cmd and enter the python command.

 

3. Start to install Django. We need to use CMD when installing Django. In the cmd command window, run the cd command to enter the Django decompression directory and find the setup. py file.

 

4. Use python setup. py install to install Django. Wait until the installation is complete.

 

5. check whether there are any errors after the installation is complete.

 

6. Run python, import Django, import Django, and then Django. VERSION to check whether the installation is successful. If the installation is successful, its version is displayed.

 

7. Configure django environment variables, C: \ Python27 \ Lib \ site-packages \ Django-1.7.11-py2.7.egg \ django \ bin path for calling when performing django-admin.py (personal understanding)

8. Create a project. The command is the django-admin.py startproject projectname is the project name (not executed in the Python command line ). This document is based on drive F.

For example:

 

 

 

9. After the project is successfully created, the directory structure is shown in figure

10. Start the built-in service: Enter python manage. py runserver in the project folder. For example

 

11. for verification, enter http: // 127.0.0.1: 8000/in the browser and you will see it.

 

The first python + django development environment can be run.

 

Legacy problems?

1. Each time you create a project, the port number is 8000. How do I set the port number and disable the running port number?

 

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.