【发布时间】:2017-04-26 23:15:30
【问题描述】:
我收到这个错误
“/admin/ 处的编程错误 关系“django_admin_log”不存在 第 1 行:..."."app_label", "django_content_type"."model" FROM "django_ad..."
django_admin_log 表在数据库中不存在。有谁知道我可以如何创建它?我不担心删除我的应用的数据。
当我尝试“./manage.py sqlmigrate admin 0001”或“./manage.py sqlmigrate admin 0001”时
我明白了 "
开始;
-- 创建模型LogEntry
>CREATE TABLE "django_admin_log" ("id" serial NOT NULL PRIMARY KEY, "action_time" timestamp with time zone NOT NULL, "object_id" text NULL, "object_repr" varchar(200) NOT NULL, "action_flag" smallint NOT NULL CHECK ("action_flag" >= 0), "change_message" text NOT NULL, "content_type_id" integer NULL, "user_id" integer NOT NULL); ALTER TABLE "django_admin_log" 添加约束 "django_admin_content_type_id_c4bce8eb_fk_django_content_type_id" 外键 ("content_type_id") 参考 "django_content_type" ("id") DEFERRABLE INITIALLY DEFERRED; ALTER TABLE "django_admin_log" 添加约束 "django_admin_log_user_id_c564eba6_fk_auth_user_id" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED; 在“django_admin_log”(“content_type_id”)上创建索引“django_admin_log_417f1b1c”; 在“django_admin_log”(“user_id”)上创建索引“django_admin_log_e8701ad4”; 提交;"
但我仍然遇到同样的错误?如果有人关心,我会使用 postgresql。
【问题讨论】:
标签: python django django-admin