python-3.x - django.core.exceptions.ImproperlyConfigured : WSGI application 'wsgi.application' could not be loaded; Error importing module

标签 python-3.x django-2.0 django-wsgi

我曾经检查过这个问题的每个答案,但没有任何帮助。这是完整的回溯:

Traceback (most recent call last):
File "/home/deadpoll/env/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 44, in get_internal_wsgi_application
return import_string(app_path)
File "/home/deadpoll/env/lib/python3.6/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/home/deadpoll/env/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 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'wsgi'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/deadpoll/env/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/home/deadpoll/env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 140, in inner_run
handler = self.get_handler(*args, **options)
File "/home/deadpoll/env/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 27, in get_handler
handler = super().get_handler(*args, **options)
File "/home/deadpoll/env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 65, in get_handler
return get_internal_wsgi_application()
File "/home/deadpoll/env/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 49, in get_internal_wsgi_application
) from err
django.core.exceptions.ImproperlyConfigured: WSGI application 'wsgi.application' could not be loaded; Error importing module.

请查看我在 github 上的完整项目:

https://github.com/nabirhossain/MyBlog

最佳答案

请确保将您的应用添加到项目的 settings.py 文件中的 INSTALLED_APPS 下。
当我错误地将应用程序添加到中间件部分下时,我遇到了同样的错误。

关于python-3.x - django.core.exceptions.ImproperlyConfigured : WSGI application 'wsgi.application' could not be loaded; Error importing module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51799455/

相关文章:

django - path() 和 re_path() 有什么区别?

python - Django URLResolver错误

Django + mod_wsgi + apache2 - 子进程 XXX 仍然没有退出,发送一个 SIGTERM

python - 如何将 `__slots__` 从 Python 2 移植到 3

python - Model.clean() 与 Model.clean_fields()

Django导入错误: cannot import name

python - pdb.set_trace 替代 apache/wsgi

WSGI 下需要的项目 * 和 * 应用程序的 Django sys.path.append

python-3.x - 控制 seaborn regplot 置信区间半透明度

python - 根据特定颜色裁剪图像