从 Django 1.11 升级到 Django 3.1 后,django admin 在内部项目顶部显示模型列表

After an upgrade from Django 1.11 to Django 3.1 django admin shows list of models on top of internal items

在Centos7上从Django 1.11(python2.7)升级到Django 3.1(python3.6)后,django admin仍然在页面顶部显示模型列表,如上此模型中的项目列表。

升级前,管理员正确显示了所有内容:您看到一个列表,输入一个项目,然后看到与该项目相关的屏幕,没有更多列表。

请看相关截图:

请指教如何解决这个问题。

也许你需要re-runcollectstatic命令

python manage.py collectstatic

请参阅 https://docs.djangoproject.com/en/3.1/ref/contrib/staticfiles/#collectstatic 了解更多选项,但 --clear 可能对您有所帮助:

python manage.py collectstatic --clear

to clear 在尝试复制或link原始文件之前清除现有文件。