Django學習筆記一


一、安裝Django:

因為之前安裝好了python3和pip,這里直接使用:

pip install Django

測試是否安裝好:

進入project目錄,創建HelloWorld項目:

C:\Users\bin>d:

D:\
>cd Django

D:\Django
>django-admin.py startproject HelloWorld

D:\Django
>tree
卷 Application 的文件夾 PATH 列表
卷序列號為 000000FA 00EE:CFD6
D:.
└─HelloWorld
└─HelloWorld

然后運行:

D:\Django\HelloWorld>python manage.py runserver 0.0.0.0:8000
Performing system checks...

System check identified no issues (0 silenced).

You have 13 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.
August 09, 2017 - 21:25:19
Django version 1.11, using settings 'HelloWorld.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.

看到如下圖就是運行成功:

 


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com