没有名称' django' - UWSGI和Python Venv问题

发布于 2025-02-13 12:54:17 字数 792 浏览 1 评论 0原文

我尝试将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文