Programming Error at admin

61 views
Skip to first unread message

kessev

unread,
Mar 17, 2017, 1:05:28 PM3/17/17
to Django users
I used the sql sever to create model but when I want to open admin page it pop out this!
What's wrong is it?







Andréas Kühne

unread,
Mar 17, 2017, 2:44:36 PM3/17/17
to django...@googlegroups.com
Have you run the migrations for the project?

It looks like you don't have the sessions table created?

Regards,

Andréas

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9130c815-f5b7-48f6-b8a6-4808d7011bae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kessev

unread,
Mar 17, 2017, 11:02:13 PM3/17/17
to Django users
Yeah, it might be the problem, when I migrated it show these error.












Andréas Kühne於 2017年3月18日星期六 UTC+8上午2時44分36秒寫道:

Andréas Kühne

unread,
Mar 18, 2017, 3:52:31 AM3/18/17
to django...@googlegroups.com
You shouldn't get any errors when running migrations. What I am guessing now is that the sessions table is missing completely or some of the columns in the table are missing. Make sure that you can run migrations properly before you try using the admin interface.

Regards,

Andréas

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Melvyn Sopacua

unread,
Mar 20, 2017, 6:38:10 AM3/20/17
to django...@googlegroups.com

On Saturday 18 March 2017 08:52:03 Andréas Kühne wrote:

> You shouldn't get any errors when running migrations. What I am

> guessing now is that the sessions table is missing completely or some

> of the columns in the table are missing.

 

But you would only be in that state, if the session migrations are in django_migrations and the tables removed afterwards.

So clearing the django_migrations table from entries with app='sessions' should recreate them, but you may get inconsistent history errors.

 

It's generally not pretty to use migrations and then hack the database. If you use migrations to alter your schema, you should always use migrations or be prepared to jump down the rabbit hole.

--

Melvyn Sopacua

Reply all
Reply to author
Forward
0 new messages