Django: How to get South to create tables for third-party apps added to INSTALL_APPS?

人盡茶涼 提交于 2019-12-19 10:05:03

问题


I am trying to use django-image-cropper (Link) in my project. I added it to INSTALL_APPS in settings.py and got resolved successfully. The app needs a handful of database tables to work with, so I gotta get them created. Since I have been using South, I need to create the tables with South, instead of using syncdb. My question is how do I run "./manage.py schemamigration" while cropper does not reside in my project directory but the python's "dist-apps" directory.


回答1:


Just run:

python manage.py schemamigration django-image-cropper --initial

and away you go.

Replace django-image-cropper with whatever the actual application is called (as defined in INSTALLED_APPS).

You then simply just use the standard migrate command to add the tables to the database.



来源:https://stackoverflow.com/questions/6021160/django-how-to-get-south-to-create-tables-for-third-party-apps-added-to-install

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