How to add custom migrations to external Django apps

我与影子孤独终老i 提交于 2019-12-11 04:49:42

问题


I've done some monkeypatching to some third-party apps in my custom Django 1.10 app, and now, when I try to create an initial migration, it also generates migrations for these external apps, but it puts those migrations in my virtualenv's site-packages directory, where they can't be version controlled.

Moreover, the monkeypatching doesn't actually change the schema. I'm just changing the verbose name and help text to be more user-friendly. There are no changes being made to the database, so there's no actual need to generate migrations for them. How do I generate my app's migration without generating them for external apps?

I tried deleting them, and removing them from my app's migration's dependencies list, but then my unittests won't run and I get the error:

django.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for...

来源:https://stackoverflow.com/questions/40597152/how-to-add-custom-migrations-to-external-django-apps

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