django-south

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

Migrations in stand alone Django app

☆樱花仙子☆ 提交于 2019-12-19 09:27:29
问题 How do I makemigrations on a stand alone Django app (ie one that is not part if any project). For example after following: https://docs.djangoproject.com/en/1.8/intro/reusable-apps/ 回答1: You can do it similar to how you do testing scripts for apps: #!/usr/bin/env python import sys import django from django.conf import settings from django.core.management import call_command settings.configure(DEBUG=True, INSTALLED_APPS=( 'django.contrib.contenttypes', 'your_app', ), ) django.setup() call

Django migrations--is it possible to use South in the middle of the project?

ぃ、小莉子 提交于 2019-12-19 08:07:57
问题 I already started a project, and the models are all synced and everything. 回答1: Yes. I think it is not too late. I've moved to south in a middle of a project and I am happy with that choice. I think it is a big help for deployment. The initialization of the south app can be done at any moment. 回答2: It's even mentioned in docs: http://south.aeracode.org/wiki/QuickStartGuide#a1.SetupeveryapplicationtobetrackablebySouth 回答3: It's quite straight forward to start using South. Just follow the

Using Django South to move from concrete inheritance to abstract inheritance

情到浓时终转凉″ 提交于 2019-12-19 05:23:55
问题 I have an existing Django project that has several models using concrete inheritance of a base class. After closer consideration, and after reading about what people like Jacob Kaplan-Moss have to say about it, using this concrete inheritance is unnecessary in my case. I would like to migrate to using an abstract base class instead. The thing that makes this complicated is that my site is live and I have user entered data. Thus, I'll need to keep all my data intact throughout this transition.

There is no South database module 'south.db.postgresql_psycopg2' for your database

家住魔仙堡 提交于 2019-12-18 18:59:17
问题 i new to django and I'm getting this error from south but i don't know what i'm missing. I search for answers but i can't found anything. There is no South database module 'south.db.postgresql_psycopg2' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS. This is my base_settings: from unipath import Path BASE_DIR = Path(__file__).ancestor(3) SECRET_KEY = 'pp@iz7%bc7%+*11%usf7o@_e&)r2o&^3%zjse)n=6b&w

Django Model Choices

半世苍凉 提交于 2019-12-18 16:54:07
问题 I've been stumped by how to make choices within my models for hours. So far I've been having issues with my approved field in the model. I want approved to be 1 of the 3 choices,but what I appear to get is a tuple of all three choices. Within './manage.py shell', I get >>> listing.objects.all()[0].approved ((u'1', u'Awaiting'), (u'2', u'No'), (u'3', u'Yes')) My Model: from django.db import models # Create your models here. class directory(models.Model): name = models.CharField(max_length="50"

Upgrade path for re-usable apps with South AND django 1.7 migrations

核能气质少年 提交于 2019-12-18 16:33:09
问题 Or: can Django 1.7 users still use South? I'm the maintainer of a re-usable app. Our policy is to always support the latest two versions of Django. We have an extensive set of South migrations and, we want to support the new Django 1.7 migration system going forward. What I'm confused with is how I can allow developers to use my app with both Django 1.6 (and South) and Django 1.7 (new migrations). The Django Documentation recommends just deleting all the pre-existing South migrations. But

“cannot be cast to type integer” error

旧街凉风 提交于 2019-12-18 13:14:22
问题 This is my first question so I will appreciate patience. I changed a few attributes to IntegerField from CharField. Listed below is the code: rating_choices = ( (1,"1"), (2,"2"), (3,"3"), (4,"4"), (5,"5"), ) class Rating(models.Model): article = models.ForeignKey(Article,null=True) organization = models.IntegerField(choices=rating_choices, default=1) support = models.IntegerField(choices=rating_choices, default=1) readability = models.IntegerField(choices=rating_choices, default=1) tags =

Django syncdb and migrate

北城以北 提交于 2019-12-18 11:27:29
问题 I'm moving django website from one server to another, and I tried to syncdb, so i've put python manage.py syncdb , and i get this output: Syncing... Creating tables ... The following content types are stale and need to be deleted: orders | ordercontact Any objects related to these content types by a foreign key will also be deleted. Are you sure you want to delete these content types? If you're unsure, answer 'no'. Type 'yes' to continue, or 'no' to cancel: no Installing custom SQL ...

Adding South to Django project, development & production

落花浮王杯 提交于 2019-12-18 10:55:22
问题 Adding South to an existing Django project. I have it installed on both the development machine and the "production" server. I've done the following on the development machine, then: added South app to settings.py, python manage.py syncdb python manage.py convert_to_south myproject.myapp then changed some models, then python manage.py schemamigration myproject.myapp --auto python manage.py migrate myproject.myapp Seems to work so far. What I am now not so sure about is what to do on the