django① python virtual environments

Newly installed python is pure, it is recommended not to install third-party libraries (purely personal OCD) at this level in python, my suggestion is to use a virtual environment,

But be sure to use a virtual environment, then you have to use another third-party library, virtualenvwapper-win, use the following command to install the library, the library's role is to create a virtual environment

pip install virtualenvwrapper-win

 

After the installation is complete

 

I suddenly thought pycharm virtual environment seem to be for me to deal with the virtual environment,

 

 

After the project is created, in pycharm, the terminal running python manage.py runserver

The role of this code is to start django, after running, no accident, then, you can access django welcome page from a browser,

python manage.py runserver 
or 
python manage.py runserver 0.0 . 0.0 : 8000 

Development: the other command manage.py Django -admin startproject mysite to create a new app

 

 


In the terminal:

(venv) H:\Pycharm\Projects\py3\django_pro1>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
July 21, 2019 - 23:25:27
Django version 2.2.3, using settings 'django_pro1.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

 

django的基本框架就建好了

 ====================================================================================================================================================================================================

参考:python虚拟环境使用

 

多说一句,这个博客的计划是,从0到能够通过互联网访问,后期会转到服务器上,liunx啊,服务器啊,域名之类的后续会在合适的地方加上

下一节,先不急着进入项目搞啥搞啥,先从pure django入手,了解django 的大致结构

 

Guess you like

Origin www.cnblogs.com/m4kemoretime/p/11223364.html