Django:如何让South创建添加到INSTALL_APPS的第三方应用程序的表? [英] Django: How to get South to create tables for third-party apps added to INSTALL_APPS?

查看:104
本文介绍了Django:如何让South创建添加到INSTALL_APPS的第三方应用程序的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 django-image-cropper 链接)在我的项目。我将它添加到settings.py中的INSTALL_APPS,并成功解决。该应用程序需要一些数据库表才能使用,所以我必须创建它们。由于我一直在使用South,所以我需要用South创建表,而不是使用 syncdb 。我的问题是如何运行./ manage.py schemamigration,而cropper不在我的项目目录中,而是python的dist-apps目录。

解决方案

只需运行:

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

并离开你。 / p>

将django-image-cropper替换为任何实际应用程序(INSTALLED_APPS中定义)。



您那么只需使用standard migrate命令将表添加到数据库。


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.

解决方案

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.

这篇关于Django:如何让South创建添加到INSTALL_APPS的第三方应用程序的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆