<p>我在Django(version=1.4)项目中使用uwsgi,但是如果运行</p>
<pre><code>uwsgi --ini django.ini
</code></pre>
<pre>
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
</pre>
<p>但我可以导入django.core.wsgi,如下所示:</p>
<pre><code>>>> import django.core.wsgi
</code></pre>
<p>django.ini文件:</p>
<pre>
[uwsgi]
chdir=/path/to/my/app
module=app.wsgi:application
master=True
vacuum=True
max-requests=5000
socket=127.0.0.1:9000
</pre>
<p>wsgi.py公司</p>
<pre><code>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()
</code></pre>