Questions tagged [django-south]
Tool to provide consistent, easy-to-use and database-agnostic database migrations for Django applications. Deprecated since Django 1.7.
1,021
questions
0
votes
1
answer
106
views
Cannot migrate Django from 1.7 to 1.8
When upgrading django 1.7 to 1.8 (final goal is migrating 1.4 to 1.11LTS)
I am asked to remove SOUTH form my INSTALLED_APPS
Fine, but then I get:
raise AppRegistryNotReady("Models aren't loaded yet....
2
votes
2
answers
342
views
TransactionManagementError “Transaction managed block ended with pending COMMIT/ROLLBACK" while making migrations in Django
When I make the migrations using python manage.py migrate manage (yes it's Django 1.8 and I can't change it :/), the migrations (every single one I tested) always fail with the same error :
django.db....
1
vote
0
answers
53
views
South migration in django
I added a new field in an existing model in django. Note that this app is already converted to south. To apply my new changes I ran these commands
python manage.py schemamigration my_app --auto
...
1
vote
1
answer
84
views
Is it safe to use Django south for handling migration on big project
From long time i am having migration issues. Each time i am droping my postgres database and creating a new When i add new 3/4 table or a relation or Circular migration happens. Or most of the time ...
18
votes
1
answer
5k
views
What is the difference between south migrations and django migrations?
Can anyone please explain me the difference between south migrations and django migrations? What advantage/disadvantage one has over another?
0
votes
1
answer
449
views
Django migrations failing with fresh database
wondering if anyone else is experiencing frustrating behavior with Django migrations. I have looked at several related posts on SO but have not found anything addressing this specifically.
This keeps ...
4
votes
0
answers
345
views
Unknown migration for 'djcelery:0001_initial' when migrating Django application using South
I got following error when migrating my Django application using South.
from django.db import models, migrations
ImportError: cannot import name migrations
I use Django==1.5.7 django-celery=...
8
votes
2
answers
4k
views
Django: How to disable Database status check at startup?
As far as I know Django apps can't start if any of the databases set in the settings.py are down at the start of the application. Is there anyway to make Django "lazyload" the initial database ...
0
votes
0
answers
192
views
Schemamigration runs for existing columns in the application
Assume I am having a Django app named animals. The app has a model named "mammal" as below
class Mammal(models.Model)
name = models.CharField(max_length=256)
is_active = models.BooleanField(...
0
votes
1
answer
805
views
Django makemigrations make change for 'auth.user' every time
I upgrade my system's django version from 1.6.10 to 1.8.16 for test.
On before version, i use South for migration.
So, I followed 'https://docs.djangoproject.com/en/1.7/topics/migrations/#upgrading-...
0
votes
1
answer
119
views
Why uses South to do migration in Django?
I am maintaining a Django project in version 1.6.X. I had found some doubt and issue a question here.
As my known, Django from version 1.7 is able to do migration. And, I started to get Django it is ...
3
votes
1
answer
604
views
Does Django 1.10 still need South to manage migrations?
I am following online instructions on starting a Django project the right way.
The instructions are based on an earlier version of Django. From my (admittedly limited) knowledge of Django. The latest ...
1
vote
0
answers
67
views
Django Redirects Causing Migration Error
I recently updated my local database to mirror production and now I am having migration issues. Trying to migrate an application called events:
./manage.py migrate events
NoMigrations: Application '&...
0
votes
1
answer
2k
views
Django: broken migrations
I am trying to setup a Django app locally in a new machine but migrations seem to be totally broken. They need to be performed in a particular order, which worked in the first machine I set the ...
2
votes
1
answer
2k
views
Django: create database tables programmatically/dynamically
I've been working on a Django app for some time now and have encountered a need for dynamic model and database table generation. I've searched far and wide and it seems as though the Django API does ...
4
votes
2
answers
4k
views
Django merge two migrations with the same ID?
I had an old git branch which has a migration that was never merged into our main branch. Since I made that migration, 14 or so migrations have been made.
I have since rebased my old branch into our ...
1
vote
1
answer
947
views
Schema migration in django south
I am trying to use schema migration as i have my models in which i had two models previously and i have created three more models.
I have tried several commands like
python manage.py ...
2
votes
0
answers
38
views
How to skip updating data of a particular table from django initial_data.json file on each south migration?
I have a initial_data.json file in my project which is loaded to the database initialy using syncdb.
Now every time when i migrate(south migration) the app, old initial_data gets updated in the table.
...
7
votes
1
answer
2k
views
Upgrading from Django 1.6 to 1.9: python manage.py migrate failure
I'm running Django 1.6.6 on production and have recently upgraded to 1.9.7 on staging (dev server). This update was performed on the server and I followed the steps outlined here Upgrading from South.
...
0
votes
0
answers
121
views
Migrations with South (Django 1.6 + MySQL) on Existing project
I need a tip on following situation
I've downloaded project with apps models, fixtures, migrations etc to local machine. Then created virtual env and made pip install -r requirements. Everything is ...
2
votes
1
answer
3k
views
ImportError: No module named south.v2 but I don't use south
I am running django 1.9 on a newly installed lubuntu 16.04. I created a virtual environment and cloned my repository from github. I try to run ./manage.py runserver and I get the error:
ImportError:...
0
votes
1
answer
80
views
Django and south migration: unexpected field came out
I'm using Django 1.6 as a banckend and I'm using South for migration.
I have two tables, Content and Channel, I added a field adress in Channel:
class Channel(models.Model):
name = models.CharField(...
0
votes
1
answer
27
views
south migrate OperationalError in backend: no such column: myModel.myField
I'm using Django 1.6 ,sqlite3 and South 1.0.1 for migrating the models.
I have a table myTableand I'd like to add a column(field) in this table.
So I add this field myField in the model.py.
Then I run:...
2
votes
2
answers
2k
views
Django - 'NoneType' object has no attribute 'replace' only on SOME users, post migration?
Recently I've been working on a system where we updated an application from a older Django version (which used South for migrations) to an up to date version (with integrated migration).
This ...
0
votes
0
answers
412
views
django doesn't detect migrations
I am using modeltranslation(https://github.com/deschler/django-modeltranslation) and django-eav(https://github.com/mvpdev/django-eav) apps. I want to translate django-eav app model's field description....
5
votes
1
answer
1k
views
Alembic Migrations without Database
Is it possible to have Alembic auto-generate migrations without it having access to the database?
For example django / south are able to do this by comparing the current version of a Model against a ...
1
vote
1
answer
707
views
Deploying Django update to live server
Django is not my main framework, I was hired on contract to update an already existing (live) Django application. Now is time for deployment of my updates to the live server, so I thought I would ask ...
6
votes
1
answer
1k
views
django-tenant-schemas: Migrate data from shared schema to multi tenant schema
How to migrate data from shared schema to multi tenant schema using django-tenant-schemas?
We have a saas and initially didn't use django-tenant-schemas but Shared Database, Shared Schema approach. ...
0
votes
0
answers
273
views
South Migration Error: NoMigrations
I'm new to South and I'm trying to perform a migration. It worked fine in local, but when I pushed the code to Heroku and tried to migrate I got this error:
Traceback (most recent call last):
...
1
vote
2
answers
2k
views
Custom index name in South/Django
Is there a way to set our own index name in Django models? Currently, the migration scripts would create a name in format [table_name]_9fcb4ba3 and I'd like to have the name more descriptive, i.e. [...
1
vote
1
answer
103
views
Django south: access model's __unicode__() method
In django south data migration file, how can I access model's __unicode__() method?
Here is a simple example:
I have a Person class in models.py:
class Person(models.Model):
name = models....
2
votes
2
answers
810
views
Django: Is there a way to retrieve ORM for past migration states?
Suppose you had a Django model:
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
And you ...
4
votes
0
answers
1k
views
Django South fake migration for test database
I started learning how to write unit tests in Django. To run a couple of example tests for an app named, organizations, I typed this in commandline:
> python manage.py test organizations.tests
...
4
votes
1
answer
419
views
Adding default tags via data migration
I am using hierarchical tags which work with taggit and treebeard. I am trying to get a data migration so I can define so tags that will be present in all instances of the app.
I have this method ...
1
vote
0
answers
365
views
Django Queryset - filter "before end date" if existing
I have model that use to don't have DateField, now I'm migrating it with "south"; and I'm adding a "start_date" and "end_date" to it:
class MyModel(models.Model):
my_attribute = models.CharField(...
0
votes
1
answer
2k
views
Add data with Django data migration
Is it possible to add, data do DB with South data migration in Django? I don't mean change of DB structure, I need to change the value of some fields. I know that it could be done via Django admin, ...
0
votes
0
answers
1k
views
Django-Mongo Migration
In my Django project i have used mysqlas my database engine and south for migration.
Now i need to use MongoDB in my project as second database. I have written database routers to use two database ...
1
vote
1
answer
433
views
How do you access mixin methods for Django models when doing a South datamigration?
My Django models have a mixin that provides a to_json method:
class Tile(models.Model, SerializableMixin):
flooring = models.ForeignKey('Flooring', related_name='tiles')
...
How do I access ...
1
vote
2
answers
7k
views
Applying migrations to a really out of sync database
I've inherited a database that's in pretty bad shape. Basically the following:
Most apps don't have a migrations folder or have an outdated one
The south migration history table is out of sync with ...
3
votes
1
answer
455
views
manage.py loaddata hangs when loading to remote postgres
I am trying to migrate django models from sqlite to postgres. I tested it locally and now trying to do the samething with remote database. I dumped the data first then started the application which ...
3
votes
0
answers
2k
views
Migrating to Django 1.8 - makemigrations creates two new migration files in the contrib/auth/migrations/ folder
I am migrating from Django 1.6.5 to Django 1.8.4 I was using South for migrations in 1.6.5 and I followed the instructions here for removing South and using Djangos inbuilt migrations
https://docs....
0
votes
0
answers
185
views
Is there any way to run django south schema-migration programmatically?
can anybody suggest me a way to programmatically run
/manage.py schemamigration appname --auto
I am creating models dynamically and i want to fake this migration at the time of model creation so ...
1
vote
0
answers
22
views
In South migration history, is the "applied" date the beginning or end of the migration?
South has the south_migrationhistory table which records when migrations are applied.
Column | Type
-----------+--------------------------
id | integer ...
0
votes
1
answer
119
views
Longer username in Django, when there are already users in the database
I am using Django 1.6 and South. There's already some data in the database. How can I migrate to a longer username field safely?
5
votes
1
answer
2k
views
South migration: delete all migration files (00*_*) and start from 0001, while keeping the original data
I am developing web systems using Django and they are deployed on Heroku. After the system goes production, all database data and the migration files (i.e., the 00*_* files) have to be retained. The ...
0
votes
1
answer
499
views
Django & Postgresql & South: convert CharField to DecimalField
I've changed a CharField to DecimalField and got this error from South:
HINT: Specify a USING expression to perform the conversion
So I googled it and used this:
db.execute(
'ALTER ...
0
votes
1
answer
196
views
Django South Migration Inconsistency
I currently have an issue with some south migrations in my django application. After doing a code merge I have come across a couple migrations with the same index. I have successfully reversed the ...
1
vote
1
answer
41
views
Django>=1.7: How to do datamigations like south?
Django>=1.7 supports schema migrations:
https://docs.djangoproject.com/fr/1.8/releases/1.7/#schema-migrations
South supported schema and data migrations.
How to create data migrations with Django>=...
1
vote
1
answer
2k
views
Circular reference in Django model?
I would like to create two models: 1) Conversation, which stores reference to the root message with a title and 2) Message, which stores content/text of the message and a reference back to the ...
5
votes
1
answer
3k
views
Is it allowed to use Model property in Django south migration, and why?
I'm using south to do schema and data migration in Django. I have a model like this:
class ModelFoo(models.Model):
first_name = models.CharField()
last_name = models.CharField()
@...