Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What to do if you start the uwsgi error message and cannot find the django module?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to start the uwsgi error prompt can not find the django module, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Start uwsgi to report an error, indicating that the module of django cannot be found

* Operational MODE: preforking * *

Added / newworld/lib/python3.5/site-packages/ to pythonpath.

Added / mysite/mysite2/mysite2/ to pythonpath.

Traceback (most recent call last):

File "/ mysite/mysite2/mysite2/wsgi.py", line 17, in

Application = get_wsgi_application ()

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

Django.setup (set_prefix=False)

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

Configure_logging (settings.LOGGING_CONFIG, settings.LOGGING)

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

Self._setup (name)

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

Self._wrapped = Settings (settings_module)

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

Mod = importlib.import_module (self.SETTINGS_MODULE)

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

Return _ bootstrap._gc_import (name [level:], package, level)

ImportError: No module named 'mysite2'

Unable to load app 0 (mountpoint='') (callable not found or import error)

* no app loaded. Going in full dynamic mode *

* uWSGI is running in multiple interpreter mode * *

Spawned uWSGI master process (pid: 83990)

Spawned uWSGI worker 1 (pid: 83992, cores: 1)

Spawned uWSGI worker 2 (pid: 83993, cores: 1)

Reason for reporting an error:

The template file of uwsgi is miswritten.

Solution:

Change the startup parameters.

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

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

Compiled with version: 5.4.0 20160609 on 28 June 2018 07:18:55

Os: Linux-4.4.0-31-generic # 50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016

Nodename: ubuntu01

Machine: x86_64

Clock source: unix

Detected number of CPU cores: 1

Current working directory: / mysite/mysite2

Detected binary path: / usr/local/bin/uwsgi

!!! No internal routing support, rebuild with pcre support!

Chdir () to / mysite/mysite2/

Your processes number limit is 3750

Your memory page size is 4096 bytes

Detected max file descriptor number: 1024

Lock engine: pthread robust mutexes

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

Uwsgi socket 0 bound to TCP address 127.0.0.1:8001 fd 3

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

Python main interpreter initialized at 0x1228790

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 416720 bytes (KB) for 8 cores

* Operational MODE: preforking+threaded * *

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

* uWSGI is running in multiple interpreter mode * *

Spawned uWSGI master process (pid: 84595)

Spawned uWSGI worker 1 (pid: 84597, cores: 2)

Spawned uWSGI worker 2 (pid: 84598, cores: 2)

Spawned uWSGI worker 3 (pid: 84599, cores: 2)

Spawned uWSGI worker 4 (pid: 84600, cores: 2)

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

Visit

The above is all the contents of this article "what to do if you can't find the django module when you start the uwsgi error message?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report