python - Django 错误配置 : WSGI application 'myproject.wsgi.application' could not be loaded; Error importing module

标签 python django wsgi

我几乎全新安装了 django,当我运行 python manage.py runserver 时。它给我这个错误:

ImproperlyConfigured: WSGI application 'myproject.wsgi.application' could not be loaded; Error importing module.

设置.py

WSGI_APPLICATION = 'myproject.wsgi.application'

wsgi.py

import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
application = get_wsgi_application()

最佳答案

注释掉

#'django.contrib.auth.middleware.SessionAuthenticationMiddleware',

在中间件的 settings.py 文件中

关于python - Django 错误配置 : WSGI application 'myproject.wsgi.application' could not be loaded; Error importing module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47800726/

相关文章:

python - 如何使用Python解密使用Vim的cryptmethod=blowfish2加密的文件?

python - 如何在谷歌地图中直观地显示路线

django - 大力神 : csrf exempt django rest framework

python - Apache mod_wsgi 和 python 2.7

python - 在 Python 中扫描一组 URL 的最快方法是什么?

python - Mod_Wsgi PythonHome 不工作

python - 无法证明 mod_wsgi 正在工作

python - 在 Python 中生成随机字符

Python:避免分数简化

python - 在 django 中发布表单后无法重定向到 URL