Django Migrating to a new Database

跟風遠走 提交于 2019-12-11 02:44:39

问题


I just joined a project using Django, and am attempting to initialize my own development server. When I attempt to do so, the migration fails for one of my apps. A model for this app has a sorl.thumbnail.ImageField, to add a logo. When the migration is attempted, I get the following error message:

FATAL ERROR - The following SQL query failed: ALTER TABLE "accounts_account" ADD CONSTRAINT "logo_id_refs_file_ptr_id_7c3d1997" FOREIGN KEY ("logo_id") REFERENCES "filer_image" ("file_ptr_id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "filer_image" does not exist

I'm not sure what the problem could be, as apparently there was no problem in creating the production database or subsequent migrations.

I believe I have correctly installed sorl-thumbnail, and all of its dependencies.

Your help would be much apperciated.


回答1:


I'm pulling the answer provided by Johndt6 from a comment to this answer for future search-ability.

The solution is to add filer to the INSTALLED_APPS tuple.



来源:https://stackoverflow.com/questions/23766072/django-migrating-to-a-new-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!