Creating a python django

A, Virtualenv (my python environment 3.7)

1, to create a virtual environment (for versions python django version and inconsistent)

Enter pip install virtuallenv, see the following information is to create a success

 

 

 2, install a separate python runtime environment (this must use, django pycharm created no independent python environment)

In the run virtualenv -p E virtualenv virtual directory under the current environment is created: \ default Python \ python \ python.exe firstpy37 (-p is specified in your python interpreter which, if not specified, will be called to explain virtualenv device; firstpy37 your project name)

Directory structure is as follows:

 

 

Three, django installation (enter firstpy37 directory, after all, just created this python standalone environment in which)

Because a package python django also, so run pip install django == 2.0.7

Specify a version is not specified, the default will install the latest version of django

Because I already installed, so they do not show how to install, but after the installation will have a django package in the lib directory of your choice below interpreter.

 

Fourth, create a project

Run python-amdin startproject project name. If you do not you will see the following error directory

 

 

 

Then, you will be able to see the project run run python manage.py runserver

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/xymaxbf/p/11908399.html