问题
After an upgrade from Django 1.11 (python2.7) to Django 3.1 (python3.6) on Centos7, django admin still shows the list of models on top of the page, above the list of items in this model.
Before the upgrade, the admin showed everything correctly: you see a list, you enter an item and see a screen related to this item, no more lists.
Please see the related screenshots:
Please advise how to solve this.
回答1:
maybe you need to re-run collectstatic
command
python manage.py collectstatic
refer to https://docs.djangoproject.com/en/3.1/ref/contrib/staticfiles/#collectstatic for more options, but --clear
is the one that may helps you:
python manage.py collectstatic --clear
to clear Clear the existing files before trying to copy or link the original file.
来源:https://stackoverflow.com/questions/64588165/after-an-upgrade-from-django-1-11-to-django-3-1-django-admin-shows-list-of-model