#1251 closed defect (invalid)
'django_admin_log' table not created by manage.py init
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | blocker | Keywords: | admin_log table |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have installed development version of django and after creating my first project I noticed that while creating subsequent projects, 'django_admin_log' table doesn't get created when running command 'python manage.py init'. So, of course when I try to log to admin section I get the error page:
ProgrammingError at /admin/
ERROR: relation "django_admin_log" does not exist SELECT "django_admin_log"."id","django_admin_log"."action_time","django_admin_log"."user_id","django_admin_log"."content_type_id","django_admin_log"."object_id","django_admin_log"."object_repr","django_admin_log"."action_flag","django_admin_log"."change_message","auth_users"."id","auth_users"."username","auth_users"."first_name","auth_users"."last_name","auth_users"."email","auth_users"."password","auth_users"."is_staff","auth_users"."is_active","auth_users"."is_superuser","auth_users"."last_login","auth_users"."date_joined" FROM "django_admin_log","auth_users" WHERE "django_admin_log"."user_id" = 1 AND "django_admin_log"."user_id" = "auth_users"."id" ORDER BY "django_admin_log"."action_time" DESC LIMIT 10
Request Method:
GET
Request URL:
Exception Type:
ProgrammingError
Exception Value:
ERROR: relation "django_admin_log" does not exist SELECT "django_admin_log"."id","django_admin_log"."action_time","django_admin_log"."user_id","django_admin_log"."content_type_id","django_admin_log"."object_id","django_admin_log"."object_repr","django_admin_log"."action_flag","django_admin_log"."change_message","auth_users"."id","auth_users"."username","auth_users"."first_name","auth_users"."last_name","auth_users"."email","auth_users"."password","auth_users"."is_staff","auth_users"."is_active","auth_users"."is_superuser","auth_users"."last_login","auth_users"."date_joined" FROM "django_admin_log","auth_users" WHERE "django_admin_log"."user_id" = 1 AND "django_admin_log"."user_id" = "auth_users"."id" ORDER BY "django_admin_log"."action_time" DESC LIMIT 10
Exception Location:
/usr/lib/python2.4/site-packages/django/core/db/base.py in execute, line 9
Template error
In template /usr/lib/python2.4/site-packages/django/contrib/admin/templates/admin/index.html, error at line 54
The only way I could fix it is if I copy empty 'django_admin_log' table from another database
You create the django_admin_log table with the command
manage.py install admin
, as explained in the tutorial.