Django搭建简单网站

打开Pycharm,创建项目

Django搭建简单网站_第1张图片

2、python manage.py startapp django_web


3、生成文件

Django搭建简单网站_第2张图片

4、setting中配置项目名

Django搭建简单网站_第3张图片

5、在templates创建html

6、在views中配置

Django搭建简单网站_第4张图片

7、配置urls

Django搭建简单网站_第5张图片

8、运行项目,完成

python manage.py runserver

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, conte
nttypes, sessions.
Run 'python manage.py migrate' to apply them.
September 03, 2019 - 16:58:13
Django version 2.2.5, using settings 'djangotest.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

9、settings配置样式

你可能感兴趣的:(Django搭建简单网站)