We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We come nearest to the great when we are great in humility.
Building a Blog Application
manage.py
python manage.py runserver
usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--ipv6] [--nothreading] [--noreload] [--nostatic] [--insecure] [addrport]
127.0.0.1:8000
python manage.py runserver 127.0.0.1:8001 --setting=mysite.settings
Project settings
settings.py
DEBUG
debug
True
False
ALLOWED_HOSTS
domain/host
INSTALLED_APPS
django.contrib.admin
django.contrib.auth
django.contrib.contenttypes
django.contrib.sessions
django.contrib.messages
django.contrib.staticfiles
MIDDLEWARE_CLASSES
request
response
django
AuthenticationMiddleware
sessions
ROOT_URLCONF
根URLconf
urls.py
DATABASES
SQLite3
LANGUAGE_CODE
zh_cn
Projects and applications
project
app
The text was updated successfully, but these errors were encountered:
No branches or pull requests
0x01 Django
Building a Blog Application
manage.py
python manage.py runserver
127.0.0.1:8000
修改如下:python manage.py runserver 127.0.0.1:8001 --setting=mysite.settings
Project settings
settings.py
DEBUG
debug
模式开关,默认True
False
,否则可能泄漏敏感信息ALLOWED_HOSTS
DEBUG
模式开或者测试时,不需要提供DEBUG
模式False
,需要为网站手动添加domain/host
INSTALLED_APPS
django.contrib.admin
管理员站点django.contrib.auth
用户验证框架django.contrib.contenttypes
文档类型框架django.contrib.sessions
会话框架django.contrib.messages
消息框架django.contrib.staticfiles
静态资源管理框架MIDDLEWARE_CLASSES
request
与response
处理之间的一道处理过程,相对比较轻量级,并且在全局上改变django
的输入与输出,因为改变的是全局,所以需要谨慎使用,用不好会影响性能,每一个中间件都会负责一个功能,例如AuthenticationMiddleware
和sessions
处理相关ROOT_URLCONF
根URLconf
的模块名,默认是urls.py
文件的模块名DATABASES
SQLite3
LANGUAGE_CODE
zh_cn
)Projects and applications
project
就是一个项目,一个项目可以有多个应用(app
),通用的app
也可以在多个项目中使用The text was updated successfully, but these errors were encountered: