django.core.exceptions.ImproperlyConfigured: WSGI

2020-07-07 05:20发布

The scenario is,

I cloned the Django code for OpenShift-V3 from here . When I run the code using python manage.py runserver getting an error as,

django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded; Error importing module: 'application doesn't look like a module path

I didn't add anything to the code and the required packages are already satisfied.

9条回答
该账号已被封号
2楼-- · 2020-07-07 05:58

Read carefully, it might say "The above exception was the direct cause of the following exception: ...". And the "above exception" being you forgot to install whitehoise. Run pip install whitenoise, it worked for me.

查看更多
小情绪 Triste *
3楼-- · 2020-07-07 05:59

in settings.py file change as follows:

WSGI_APPLICATION = 'your_project_name.wsgi.application'

查看更多
相关推荐>>
4楼-- · 2020-07-07 05:59

I was using django-cors-headers, then I thought I haven't implemented cors in my project, so went ahead to install django-cors-middleware, then it's started giving the wsgi exception, so i checked the stack trace and I found out that it's django-cors-headers and django-cors-middleware conflicting each other. I had to uninstall django-cors-middleware but it's still gives the same exception, so uninstall django-cors-headers too then reinstall and everything works fine....

查看更多
登录 后发表回答