Search code examples
pythondjangopython-3.xdjango-1.8pythonanywhere

Python 3.4 Django 1.8 PythonAnywhere ImproperlyConfigured


Trying to deploy my project on pythonanywhere.

  • python3.4
  • Django 1.8.7
  • Username - GriMel
  • Project name - TwDTutor

wsgi configuration file

import os
import sys
path = '/home/GriMel/TwDTutor'
if path not in sys.path:
    sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'TwDTutor.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Static files

/static/admin   /home/GriMel/.virtualenvs/rango/lib/python3.4/site-packages/django/contrib/admin/static/admin
/static/    /home/GriMel/TwDTutor/rango/static

Get the error

django.core.exceptions.ImproperlyConfigured: Module "django.contrib.auth.middleware" does not define a "SessionAuthenticationMiddleware" attribute/class

Solution

  • That error usually indicates that there's a Django version mismatch so you probably haven't set the virtualenv correctly on the web app tab.