django-south

Django South Seg Fault

ε祈祈猫儿з 提交于 2019-12-08 07:01:00
问题 I just updated from Ubuntu 12.04 to 13.04, and I am having issues migrating some code that used to work. Googling does not reveal anything that obviously looks related except some obscure R references, and though my project does use R I would not expect it to crop up in migrations. I have never dealt with debugging seg faults before, much less in 3rd party code. How should I proceed? (project)ben@Watt:~/Projects/project/project$ python project/manage.py migrate Error: 'rho' must be an

How to deal with old pip requirement in Django South migrations?

落爺英雄遲暮 提交于 2019-12-08 02:52:03
问题 I have an app which is managed with South for quite a while. At one point of the development, I added a custom field to a model that had a pip requirement (sorl-thumbnail), but I removed this requirement later. My problem is that when I try to migrate this app in a fresh new database, South shouts: ./manage.py migrate my_app ... ValueError: Cannot import the required field 'sorl.thumbnail.fields.ImageField' How am I suppose to deal with this old requirement? 回答1: Maybe a dirty solution but if

Django Unit Tests Missing Database Columns

时光毁灭记忆、已成空白 提交于 2019-12-07 16:45:41
问题 I created a unit test on Django to create a user account and send a verification e-mail. The user is created, but the e-mail fails to send. The e-mail's default contents are supposed to be created as a field in the user when a user is created, but for some reason, Django is claiming - DatabaseError: no such column: app_userprofile.default_email_header It works fine when the account is created manually, though for some reason it fails to create that column in the database when done from a unit

Programmatically check whether there are django south migrations that need to be deployed

大兔子大兔子 提交于 2019-12-07 01:58:45
问题 My deployment strategy looks like this (using Fabric): create a new virtualenv deploy new code in new virtualenv show a maintenance page copy the current db to new db migrate new db point new code to new db symlink current virtualenv to new venv restart services remove maintenance page I want to iterate fast. Now, most of the code changes do not contain migrations. Also, the db is growing, so there is much overhead created by copying the database everytime I deploy a (mostly small) change. To

Renaming auth_user breaks migrations on fresh setup

梦想的初衷 提交于 2019-12-07 01:40:44
问题 Following what seems like good advice, I migrated from Django's built-in auth.User to my own app.User by doing a migration that renames auth_user to app_user . So far so good, this works fine. The problem comes when I set up a new machine. In my settings.py I have AUTH_USER_MODEL = 'app.User' . Because of this, when I run syncdb , the auth_user table is not created, so when I migrate , that migration fails. The only way around this I've found is to modify AUTH_USER_MODEL to point to auth.User

How do I “unconvert” an app from South (Django)?

心不动则不痛 提交于 2019-12-07 01:12:03
问题 I changed a lot in my models.py , including deleting a lot of fields, and renaming a couple of classes. schemamigration --auto worked fine, but trying migrate threw a bunch of errors. All my code is currently in development so I don't mind too much losing the data. So I want South to "unconvert" or "unmanage" an app so I can rebuild all the tables with syncdb again. Or I could delete all migration list and do schemamigration --initial again. 回答1: Yes, just delete the migrations and run

django south migration and USE_TZ=True

纵饮孤独 提交于 2019-12-06 21:14:04
I've changed all my code to use aware-time by using django.utils.timezone.now() I changed datetimefield to use default=timezone.now , and set USE_TZ=True in settings.py After the changes, I ran south schemamigration command and it doesn't pick up the database fields change. I'm using the south 0.7.6 and postgresql if that matters. Here's the detailed change I made to make my entire site timezone aware. how do I make my site timezone aware? Bryce If you use south, and change USE_TZ=False to USE_TZ=True , all your old migrations will likely break, and you'll get errors like: RuntimeWarning:

How to deal with old pip requirement in Django South migrations?

限于喜欢 提交于 2019-12-06 14:33:23
I have an app which is managed with South for quite a while. At one point of the development, I added a custom field to a model that had a pip requirement (sorl-thumbnail), but I removed this requirement later. My problem is that when I try to migrate this app in a fresh new database, South shouts: ./manage.py migrate my_app ... ValueError: Cannot import the required field 'sorl.thumbnail.fields.ImageField' How am I suppose to deal with this old requirement? Maybe a dirty solution but if you really want to get rid of your sorl-thumbnail dependency you don't have much choice : Locate the

south django migrate

自作多情 提交于 2019-12-06 04:01:51
问题 I just did: python manage.py schemamigration TestDBapp1 --initial python manage.py schemamigration TestDBapp1 --auto Successfully. But if I enter: python manage.py migrate TestDBapp1 I get this: sqlite3.OperationalError: table "TestDBapp1_xyz" already exists What could be the problem? 回答1: I suspect that you already executed syncdb which created the tables. South tries to create them again during migrate and naturally the database complains. To avoid this you have to tell South to "fake" the

Can't add a new field in migration: “column .. does not exist”

南楼画角 提交于 2019-12-06 03:43:58
I want to add a field to my model but I'm completely lost here. This is the model, the app name is called "profiles": class Profiles(models.Model): user = models.OneToOneField(User, unique=True, null=True) nickname = models.CharField(max_length=75, null=True) # new field description = models.CharField(max_length=250, blank=True, null=True) So, I added the "nickname" field. Then I ran python manage.py schemamigration profiles --auto python manage.py migrate profiles But it gave me an error. "relation profiles_profiles already exists." So I did python manage.py migrate profiles --fake python