Code

Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#1251 closed defect (invalid)

'django_admin_log' table not created by manage.py init

Reported by: arnold.brownie@… Owned by: adrian
Component: contrib.admin Version: master
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: UI/UX:

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

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:2 Changed 8 years ago by adrian

  • milestone Version 0.92 deleted

Milestone Version 0.92 deleted

comment:3 Changed 7 years ago by anonymous

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

comment:4 Changed 5 years ago by Jacques Mattheij <j@…>

the correct command for V 1.0 is:

python manage.py syncdb

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.