Programming Error at admin

已查看 61 次
跳至第一个未读帖子

kessev

未读,
2017年3月17日 13:05:282017/3/17
收件人 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

未读,
2017年3月17日 14:44:362017/3/17
收件人 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

未读,
2017年3月17日 23:02:132017/3/17
收件人 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

未读,
2017年3月18日 03:52:312017/3/18
收件人 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

未读,
2017年3月20日 06:38:102017/3/20
收件人 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

回复全部
回复作者
转发
0 个新帖子