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

ZYKY picture ZYKY · Dec 13, 2017 · Viewed 18.5k times · Source

I have an almost fresh install of django and when I try to python manage.py runserver.It is is giving me this error:

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

settings.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()

Answer

skuli434 picture skuli434 · May 21, 2018

Comment out the

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

in your settings.py file in Middleware