[Answered ]-ImproperlyConfigured: Error importing module django.contrib.locale: "No module named locale"

2👍

i think, locale middlware should come before common middleware: docs say that

… And it should come before CommonMiddleware
because CommonMiddleware needs an activated language in order to
resolve the requested URL.

MIDDLEWARE_CLASSES = (
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.locale.LocaleMiddleware',
  'django.middleware.common.CommonMiddleware',
)

Leave a comment