mysite.wsgi 创建 django 项目后文件丢失
mysite.wsgi file is missing after creating django project
我尝试部署nginx+uwsgi+django。
在 .ini 文件中需要设置 module=mysite.wsgi。
但是在我的项目目录中没有任何 .wsgi 文件。
创建的项目
django-admin.py startproject xproj
为什么可能?
在 Django 1.4.0 及更高版本中 wsgi.py 存在于 xproj->xproj 文件夹下。
Django 提供 wsgi.py
与网络服务器交互。
其实wsgi.py
就是你要的文件。如您所见here.
You see in Python people often use the Python module syntax when talking about files. So for example if you are talking about your models[.]py
in a module named "Users" you wouldn't say users/models[.]py
you would say users.models. This is what the gunicorn docs are doing. The writer of the docs is talking about the file myproject/wsgi[.]py
but is using the module syntax of myproject.wsgi
.
我尝试部署nginx+uwsgi+django。 在 .ini 文件中需要设置 module=mysite.wsgi。 但是在我的项目目录中没有任何 .wsgi 文件。
创建的项目django-admin.py startproject xproj
为什么可能?
在 Django 1.4.0 及更高版本中 wsgi.py 存在于 xproj->xproj 文件夹下。
Django 提供 wsgi.py
与网络服务器交互。
其实wsgi.py
就是你要的文件。如您所见here.
You see in Python people often use the Python module syntax when talking about files. So for example if you are talking about your
models[.]py
in a module named "Users" you wouldn't sayusers/models[.]py
you would say users.models. This is what the gunicorn docs are doing. The writer of the docs is talking about the filemyproject/wsgi[.]py
but is using the module syntax ofmyproject.wsgi
.