Django Project: The project environment to build ---- First, create a django project

Project environment to build

First, create a django project

1. Create a python virtual environment

Create a python virtual environment on a virtual machine, because the actual deployment of the project, it is linux

mkvirtualenv -p /usr/bin/python3.6 tzproject

2. Create a django project

1. Install django

Choose to install the latest version django2.1.x 2.1.10

pip install django==2.1.10

2. Create a django project

~ cd / Project /         # cd to where you want to put django project path 
django-admin startproject tzproject

3. Create a project pycharm

By remote project pycharm connected virtual machines, development.

1. Select the project directory

Select the directory you want to store the project file, pay attention to the root directory of pycharm django project and the project must be consistent, do not use a pycharm project, managing multiple django project.

2. Configure Remote Interpreter

Configure the virtual interpreter just created

 

3. Configure remote project path

 

4. Set Configuration Synchronization

 

 

 

 

 

 

 

 

 

 

 

 

5. Code Download

 

 

 

 

4.pycharm Configure Django project

After Codes, you need to be configured to project in the Project django pycharm in order to use a variety of convenient pycharm prompts.

 

 

 

 

 

 

 

 

 

 Do port mapping virtual machine, enter in the browser, http://127.0.0.1:8000you should see the following screen

 

Guess you like

Origin www.cnblogs.com/Tmclri/p/11514987.html