Update wsgi.py

hjn_branch
plqo32bax 3 months ago
parent 8a1339a4f1
commit dfa842c1fe

@ -1,16 +1,22 @@
"""
WSGI config for djangoblog project.
It exposes the WSGI callable as a module-level variable named ``application``.
WSGIWeb Server Gateway Interface是Python的Web服务器网关接口是Django的主要部署平台
这个文件包含了WSGI可调用对象作为模块级别的变量名为`application`
For more information on this file, see
更多关于此文件的信息请参考
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
# 设置Django的默认设置模块环境变量
# DJANGO_SETTINGS_MODULE环境变量告诉Django应该使用哪个设置模块
# 当WSGI服务器加载应用时Django需要知道使用哪个设置文件来配置整个应用[6,7](@ref)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoblog.settings")
application = get_wsgi_application()
# 获取WSGI可调用应用程序对象
# 这个application对象是WSGI服务器与Django应用通信的接口[6,9](@ref)
# get_wsgi_application()函数返回一个符合WSGI标准的可调用应用程序对象
application = get_wsgi_application()
Loading…
Cancel
Save