我正在为我的 Django(version =1.4) 项目使用 uwsgi,但是如果我运行则会出现错误
uwsgi --ini django.ini
从 django.core.wsgi 导入 get_wsgi_application ImportError:没有名为 django.core.wsgi 的模块
但我可以按如下方式导入 django.core.wsgi:
>>> import django.core.wsgi
django.ini 文件:
[uwsgi] chdir=/path/to/my/app 模块=app.wsgi:应用程序 大师=真 真空=真 最大请求数=5000 套接字=127.0.0.1:9000
wsgi.py
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.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()