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

时间:2018-08-11 12:01:41

标签: 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

1 个答案:

答案 0 :(得分:1)

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