这可能是一个非常愚蠢的问题;我正在尝试使用 Gunicorn 部署 Django 应用程序。但是,我刚刚创建了如下所示的 wsgi.py(wsgi.py 在我的根项目文件夹中):
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
现在我跑了:
python manage.py run_gunicorn
Gunicorn 会自动获取这个 wsgi.py 吗?这是如何运作的?(不确定 wsgi 在做什么)。还是我需要指定一些东西?