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
Similar Posts:
- ERRORS: ?: (corsheaders.E013) Origin ‘*’ in CORS_ORIGIN_WHITELIST is missing scheme or ne…
- Django admin Error: ‘WSGIRequest’ object has no attribute ‘user’
- [Django CSRF tutorial] solve the problem of forbidden (403) CSRF verification failed. Request aborted
- [Solved] DjangoORM Run python manage.py makemigrations Error: no changes detected
- Django @csrf_exempt Cannot work in class view (Django @csrf_exempt not working in class View)
- How to Solve Django xadmin installation Error [7 Types of Errors]
- Python2.7 Error: command not found: django-admin.py [How to Solve]
- ImportError: cannot import name ‘patterns’
- Django startup error: generator expression must be parentized
- django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named ‘M…