新创建的django项目,目录如下
- manage.py
通django项目一起工作的工具。 - settings.py
包含项目的默认设置,包括数据库信息、调试标志以及其他一些重要的变量。 - urls.py
将url模式映射到应用程序上的配置文件。
通过python manage.py runserver
运行,
也可以按照下图进行设置,运行manage.py
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.
November 28, 2016 - 10:05:36
Django version 1.10.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
上图显示页面请求成功,在后台可以看到日志,从左到右有4个部分:时间戳、请求、HTTP状态码、以及字节数。
[28/Nov/2016 10:05:49] "GET / HTTP/1.1" 200 1767