「已注销」 2021-08-16 11:24 采纳率: 0%
浏览 45
已结题

UWSGI+Django部署的问题

调试uwsgi没有问题,单独启用django也没有问题,但是使用uwsgi启动我的django的时候,会报错

Python version: 3.6.9 (default, Jan 26 2021, 15:33:00)  [GCC 8.4.0]
PEP 405 virtualenv detected: /home/cute/testproj/venv
Set PythonHome to /home/cute/testproj/venv
Python main interpreter initialized at 0x564af5aff3a0
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 166688 bytes (162 KB) for 2 cores
*** Operational MODE: threaded ***
Traceback (most recent call last):
  File "/home/cute/testproj/testproj/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
  File "/home/cute/testproj/venv/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/home/cute/testproj/venv/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/home/cute/testproj/venv/lib/python3.6/site-packages/django/conf/__init__.py", line 82, in __getattr__
    self._setup(name)
  File "/home/cute/testproj/venv/lib/python3.6/site-packages/django/conf/__init__.py", line 69, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/cute/testproj/venv/lib/python3.6/site-packages/django/conf/__init__.py", line 170, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'testproj'
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

这是我的ini文件


[uwsgi]
socket = 127.0.0.1:8090
chdir = /home/cute/testproj/testproj
wsgi-file = /home/cute/testproj/testproj/wsgi.py
master = true
proccesses = 5
threads = 2
vacuum = true
safe-pidfile = /home/cute/testproj/testproj.pid
daemonize = /home/cute/testproj/uwsgilog.log
home = /home/cute/testproj/venv

我的虚拟环境是使用

python -m venv venv

设置的。

  • 写回答

1条回答 默认 最新

  • 有问必答小助手 2021-08-17 20:25
    关注

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


    本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


    ​因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。

    评论

报告相同问题?

问题事件

  • 系统已结题 8月24日
  • 创建了问题 8月16日

悬赏问题

  • ¥15 12864只亮屏 不显示汉字
  • ¥20 三极管1000倍放大电路
  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
  • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令