Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
Before, because of the internationalization of Django, many things have been changed in settings.py. Internationalization is easy to use, but today when we want to use the site management admin! wrong! It’s over
When I used it the day before yesterday, it was OK. My models.py and admin.py are OK. The settings.py are as follows:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR + "/templates"],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.tz',
],
},
},
]
So I spent an afternoon…… By the way, my version of Django is 1.11.8
Because internationalization added a lot of things to it
These are the things added in Django of different versions in different international tutorials. However, these things directly lead to errors in admin. Therefore, delete them (I don’t believe before deleting them)
All right
So I added something