Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#1251 closed defect (invalid)

'django_admin_log' table not created by manage.py init

Reported by: arnold.brownie@… 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:

http://patrick:8000/admin/

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

Change History (4)

comment:1 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

You create the django_admin_log table with the command manage.py install admin, as explained in the tutorial.

comment:2 by Adrian Holovaty, 17 years ago

milestone: Version 0.92

Milestone Version 0.92 deleted

comment:3 by anonymous, 17 years ago

command manage.py install admin maybe change to manage.py syncdb admin

comment:4 by Jacques Mattheij <j@…>, 15 years ago

the correct command for V 1.0 is:

python manage.py syncdb

Note: See TracTickets for help on using tickets.
Back to Top