没有名称' django' - UWSGI和Python Venv问题
我尝试将UWSGI与Django应用程序一起进行测试,但我遇到了错误。
trackback(最近的最新电话): 文件“ ./sitefirst/wsgi.py”,第12行,in 来自django.core.wsgi import get_wsgi_application Importerror:没有名为'django 的模块
似乎没有激活我的python venv, fisrtsite 。我使用以下命令。
uwsgi -http:8080 -h/home/mo/mo/first Sote -chdir/home/mo/mo/sitefirst -w sitefirst.wsgi
我的Venv fisrtsite python 3.7 Django。 UWSGI带有Python 3.5.2,此版本没有Django。
我创建了称为 fisrtsite 的VENV并安装Django并创建了Test Django项目。我在全球安装了UWSGI,在处理多个Django项目时会产生较少的摩擦。
sudo apt-get install python3-dev
sudo -h pip3 install uwsgi
我确定UWSGI成功安装了。我使用一个简单的Python文件进行了测试,并且可以工作。
我的Linux服务器是Ubuntu,默认情况下,带有Python 2。
任何帮助和思想都将不胜感激。
I tried to use uWSGI with my django application for testing, but I got the error.
Traceback (most recent call last):
File "./sitefirst/wsgi.py", line 12, in
from django.core.wsgi import get_wsgi_application
ImportError: No module named 'django
It seems uWSGi is not activating my Python venv, fisrtsite. I use the following command.
uwsgi --http :8080 -H /home/mo/firstsite --chdir /home/mo/sitefirst -w sitefirst.wsgi
My venv fisrtsite has python 3.7 and has Django. uWSGi comes with Python 3.5.2 and this version does not have have Django.
I created venv called fisrtsite and install Django and created test Django project. I installed uWSGI globally to create less friction in handling multiple Django projects.
sudo apt-get install python3-dev
sudo -H pip3 install uwsgi
I am sure that uwsgi installed successfully. I tested using a simple python file and it works.
My linux server is Ubuntu with python 2 as default.
Any help and thought would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论