这可能是一个非常愚蠢的问题;我试图使用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是在干什么)。还是我需要指定一些内容?