简体   繁体   中英

Issue in django.core.exceptions.ImproperlyConfigured

I added social_django.middleware.SocialAuthExceptionMiddleware

MIDDLEWARE = [
    'social_django.middleware.SocialAuthExceptionMiddleware',
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

Error:

django.core.exceptions.ImproperlyConfigured: WSGI application 'Project2.wsgi.application' could not be loaded; Error importing module.

You defined somewhere in your settings file the following line:

WSGI_APPLICATION = 'Project2.wsgi.application'

That means you must have under your Project2 directory a wsgi.py file that declare the wsgi application. It should look like this:

import os
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

More details in the official doc here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM