django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded

前端 未结 14 3120
[愿得一人]
[愿得一人] 2021-02-20 06:19

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,

相关标签:
14条回答
  • 2021-02-20 06:31

    Did you use python manage.py Appname

    do not use django-admin startapp AppName

    It will solve the problem

    0 讨论(0)
  • in settings.py file change as follows:

    WSGI_APPLICATION = 'your_project_name.wsgi.application'

    0 讨论(0)
  • 2021-02-20 06:37

    Go to django-ex/project/settings.py

    Change the line in settings.py as below

    WSGI_APPLICATION = 'application' to WSGI_APPLICATION = 'wsgi.application'

    That's it :(

    0 讨论(0)
  • 2021-02-20 06:39

    If you run django project locally for development, just remove WSGI_APPLICATION variable from settings.py module. It needs in prod/stage settings, for example settings_prod.py

    0 讨论(0)
  • 2021-02-20 06:41

    Same problem.. I checked whether django-cors-middleware and django-cors-headers installed or not. I found those were not installed and then I installed them.

    1. python -m pip install django-cors-middleware
    2. python -m pip install django-cors-headers

    Then,

    1. python manage.py migrate
    2. python manage.py runserver

    Finally, it's worked....

    0 讨论(0)
  • 2021-02-20 06:42

    I tried all these solution and the one worked for me was this:

    pip install django-htmlmin
    

    This module was missing and not mentioned in requirements.txt Shows long error message that ends with wsgi application improperly configured. But somewhere in middle I could see "No module named 'htmlmin' I installed and it is resolved.

    0 讨论(0)
提交回复
热议问题