This is part of the settings file generated when I create a project with
Python 3.7.3 and Django 2.2.3
MIDDLEWARE = [
'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',
]
On Monday, July 15, 2019 at 12:42:16 PM UTC+1, Curtis Maloney wrote:
>
> On Mon, 15 Jul 2019, at 21:36, Ehigie Aito wrote:
>
> Like I said, in older versions of Django, that variable used to be named
> MIDDLEWARE_CLASSES, if I create a Django project with Python 3.7 and Django
> 2.2.3, its MIDDLEWARE but Python 3.8 and Django 2.2.3 its named
> MIDDLEWARE_CLASSES which on running python manage.py runserver fails. Here
> is the traceback:
>
>
> So you're saying that "django-admin startproject" will produce a different
> settings file based on the version of Python?
>
> Can you show us a comparison, please?
>
> Exception in thread django-main-thread:
> Traceback (most recent call last):
> File "/usr/local/lib/python3.8/threading.py", line 923, in
> _bootstrap_inner
> self.run()
> File "/usr/local/lib/python3.8/threading.py", line 865, in run
> self._target(*self._args, **self._kwargs)
> File
> "/home/pystar/.local/share/virtualenvs/del-wUbba1cG/lib/python3.8/site-packages/django/utils/autoreload.py",
>
> line 54, in wrapper
> fn(*args, **kwargs)
> File
> "/home/pystar/.local/share/virtualenvs/del-wUbba1cG/lib/python3.8/site-packages/django/core/management/commands/runserver.py",
>
> line 117, in inner_run
> self.check(display_num_errors=True)
> File
> "/home/pystar/.local/share/virtualenvs/del-wUbba1cG/lib/python3.8/site-packages/django/core/management/base.py",
>
> line 436, in check
> raise SystemCheckError(msg)
> django.core.management.base.SystemCheckError: SystemCheckError: System
> check identified some issues:
>
> ERRORS:
> ?: (admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware'
> must be in MIDDLEWARE in order to use the admin application.
> ?: (admin.E409) 'django.contrib.messages.middleware.MessageMiddleware'
> must be in MIDDLEWARE in order to use the admin application.
> ?: (admin.E410) 'django.contrib.sessions.middleware.SessionMiddleware'
> must be in MIDDLEWARE in order to use the admin application.
>
>
> This does look troublesome. Can you show the settings file used?
>
> --
> C
>
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/002bb721-a76c-4052-8d0e-d59cf388ff2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.