I have setup a new database with MySQL and run
我用MySQL建立了一个新的数据库并运行
python manage.py migrate
then run
然后运行
python loaddata db.json
to load data from my previous sqlite database.
从我以前的sqlite数据库加载数据。
But now when I try to access the admin pages I get
但是现在当我尝试访问管理页面时,我得到了
ProgrammingError at /admin/
(1146, "Table 'myapp.django_admin_log' doesn't exist")
Other answers say to run syncdb but it not longer exists.
其他的回答说运行syncdb,但是它已经不存在了。
Any ideas?
什么好主意吗?
1 个解决方案
#1
1
Add django.contrib.admin
in your INSTALLED_APPS
, then run python manage.py migrate admin
to create initial db tables for admin
application. It will create django_admin_log
table for you.
添加django.contrib。在INSTALLED_APPS中进行管理,然后运行python管理。将admin迁移到为admin应用程序创建初始db表。它将为您创建django_admin_log表。
#1
1
Add django.contrib.admin
in your INSTALLED_APPS
, then run python manage.py migrate admin
to create initial db tables for admin
application. It will create django_admin_log
table for you.
添加django.contrib。在INSTALLED_APPS中进行管理,然后运行python管理。将admin迁移到为admin应用程序创建初始db表。它将为您创建django_admin_log表。