广告
返回顶部
首页 > 资讯 > 精选 >启动uwsgi报错提示找不到django的模块怎么办
  • 767
分享到

启动uwsgi报错提示找不到django的模块怎么办

2023-06-02 12:06:10 767人浏览 独家记忆
摘要

小编给大家分享一下启动uwsgi报错提示找不到Django的模块怎么办,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!启动uwsgi报错,提示找不到djanGo的模

小编给大家分享一下启动uwsgi报错提示找不到Django的模块怎么办,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

启动uwsgi报错,提示找不到djanGo的模块

  1. *** Operational MODE: preforking ***

  2. added /newworld/lib/python3.5/site-packages/ to pythonpath.

  3. added /mysite/mysite2/mysite2/ to Pythonpath.

  4. Traceback (most recent call last):

  5.   File "/mysite/mysite2/mysite2/wsgi.py", line 17, in <module>

  6.     application = get_wsgi_application()

  7.   File "/newworld/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application

  8.     django.setup(set_prefix=False)

  9.   File "/newworld/lib/python3.5/site-packages/django/__init__.py", line 19, in setup

  10.     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)

  11.   File "/newworld/lib/python3.5/site-packages/django/conf/__init__.py", line 56, in __getattr__

  12.     self._setup(name)

  13.   File "/newworld/lib/python3.5/site-packages/django/conf/__init__.py", line 43, in _setup

  14.     self._wrapped = Settings(settings_module)

  15.   File "/newworld/lib/python3.5/site-packages/django/conf/__init__.py", line 106, in __init__

  16.     mod = importlib.import_module(self.SETTINGS_MODULE)

  17.   File "/newworld/lib/python3.5/importlib/__init__.py", line 126, in import_module

  18.     return _bootstrap._GC_import(name[level:], package, level)

  19. ImportError: No module named 'mysite2'

  20. unable to load app 0 (mountpoint='') (callable not found or import error)

  21. *** no app loaded. going in full dynamic mode ***

  22. *** uWSGI is running in multiple interpreter mode ***

  23. spawned uWSGI master process (pid: 83990)

  24. spawned uWSGI worker 1 (pid: 83992, cores: 1)

  25. spawned uWSGI worker 2 (pid: 83993, cores: 1)


报错原因:
uwsgi的模板文件书写有误。

解决方法:
更改启动参数。

  1. (newworld) neo@ubuntu01:/mysite/mysite2$ uwsgi --Socket 127.0.0.1:8001 --chdir /mysite/mysite2/ --wsgi-file mysite2/wsgi.py --master --processes 4 --threads 2 --stats 127.0.0.1:9191

  2. *** Starting uWSGI 2.0.17 (64bit) on [Fri Jun 29 00:02:58 2018] ***

  3. compiled with version: 5.4.0 20160609 on 28 June 2018 07:18:55

  4. os: linux-4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016

  5. nodename: ubuntu01

  6. Machine: x86_64

  7. clock source: unix

  8. detected number of CPU cores: 1

  9. current working directory: /mysite/mysite2

  10. detected binary path: /usr/local/bin/uwsgi

  11. !!! no internal routing support, rebuild with pcre support !!!

  12. chdir() to /mysite/mysite2/

  13. your processes number limit is 3750

  14. your memory page size is 4096 bytes

  15. detected max file descriptor number: 1024

  16. lock engine: pthread robust mutexes

  17. thunder lock: disabled (you can enable it with --thunder-lock)

  18. uwsgi socket 0 bound to tcp address 127.0.0.1:8001 fd 3

  19. Python version: 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]

  20. Python main interpreter initialized at 0x1228790

  21. python threads support enabled

  22. your server socket listen backlog is limited to 100 connections

  23. your mercy for graceful operations on workers is 60 seconds

  24. mapped 416720 bytes (406 KB) for 8 cores

  25. *** Operational MODE: preforking+threaded ***

  26. WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1228790 pid: 84595 (default app)

  27. *** uWSGI is running in multiple interpreter mode ***

  28. spawned uWSGI master process (pid: 84595)

  29. spawned uWSGI worker 1 (pid: 84597, cores: 2)

  30. spawned uWSGI worker 2 (pid: 84598, cores: 2)

  31. spawned uWSGI worker 3 (pid: 84599, cores: 2)

  32. spawned uWSGI worker 4 (pid: 84600, cores: 2)

  33. *** Stats server enabled on 127.0.0.1:9191 fd: 15 ***


访问
启动uwsgi报错提示找不到django的模块怎么办

以上是“启动uwsgi报错提示找不到django的模块怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注编程网精选频道!

--结束END--

本文标题: 启动uwsgi报错提示找不到django的模块怎么办

本文链接: https://www.lsjlt.com/news/230053.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作