django.core.exceptions.ImproperlyConfigured:无法加载WSGI应用程序'wsgi.application';导入模块时出错

问题描述 投票:0回答:1

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

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

python-3.x django-2.0 django-wsgi
1个回答
1
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.