Build a Django project under the Windows system

Source: Internet
Author: User
Tags install django virtual environment virtualenv

First, the Environment version information:

Operating system: WINDOWS10

Django Version: 2.0.5

Python version: 3.6.4

Second, create a virtual environment:

1. Why to create a virtual environment:

We want to develop a new project that requires a separate Python runtime environment. If Project a uses a different version of the environment than project B, creating separate virtual environments for project A and B will not interfere with each other .

2, to create the prerequisite to install Virtualenv:

PIP3 Install Virtualenv

3. How to create:

(1), create a new folder named Demo

(2), enter the folder to open the command line. (shift+ right mouse button)

(3), enter at the command line: python-m venv my_venv A complete Python environment is generated in scripts under the newly created My_venv folder.

Third, install Django:

1. my_venv folder under Scripts Enter the command line (shift+ right mouse button) or input from the previous step command line: CD my_venv/scripts enter into the Scripts folder with the command line: Activate is used to activate the virtual environment.

2. Install Django and enter it on the command line: PIP3 install Django

Iv. creation of the project:

1. Create a Django environment and enter it at the command line on the previous step: Django-admin Startproject my_project The Django project folder appears under the Scripts folder.

2, create the project name for the app, command line into the My_project folder input: Python manage.py startapp app in the My_project folder will appear under the app folder

3. Run the project: Enter in the command line: Python manage.py runserver

For example, the arrow refers to the local URL: The Http://127.0.0.1:8000/project URL, and Http://127.0.0.1:8000/admin is the Django-brought background management interface

Build a Django project under the Windows system

Related Article

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.