django-south

Django not creating db tables for models (neither with syncdb nor South)

谁说我不能喝 提交于 2020-01-10 05:11:27
问题 I have a Django project on a Centos VPS. I created some models and debugged them so they validate and give no errors. I have them in a "models" folder in my myapp and have added each model to the init file in this directory, for example: from category import Category I added the app to settings.py INSTALLED_APPS and ran: Python manage.py syncdb It appeared to work fine and added all tables apart from the ones for my app. I then installed South and added that to INSTALLED_APPS and, tried

Django South migration AttributeError

浪子不回头ぞ 提交于 2020-01-03 17:34:53
问题 I'm suffering from this error when migrating South (0.7.5) in Django (1.4). I recently changed the Timezone setting to false, i.e. USE_TZ = False to fix another problem. Any ideas? Thanks ~/code/django/ssc/dev/ssc/ssc: python manage.py migrate crewcal Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in

Adding Simple Custom Field to Django — How to Write South Introspection Rules

自古美人都是妖i 提交于 2020-01-01 09:53:27
问题 I am trying to add a custom field to my Django project that uses South. Because of this, I am trying (for the first time) to write introspection rules for South. I believe my case is the simplest possible as I am simply extending a CharField. Specifically: class ColorField(models.CharField): def __init__(self, *args, **kwargs): kwargs['max_length'] = 10 super(ColorField, self).__init__(*args, **kwargs) def formfield(self, **kwargs): kwargs['widget'] = ColorPickerWidget return super(ColorField

Changing South Migration Directory

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-01 04:46:06
问题 How do you change the location where South looks for an app's migrations? By default, South assumes an app's migrations are in /migrations. However, I've migrated the model of a third-party package which is installed at /usr/local/lib/python-2.6/dist-packages/, so South is looking for migrations there, instead of the location of my custom codebase. 回答1: In settings.py: SOUTH_MIGRATION_MODULES = { 'books': 'myproject.app_name.migrations', } 来源: https://stackoverflow.com/questions/5994420

django 1.7 migrations — how do I clear all migrations and start over from scratch?

落花浮王杯 提交于 2019-12-31 08:06:05
问题 So I'm rapidly iterating on a django app at the moment and I'm constantly adjusting models.py. Over the course of a day or two of programming and testing I generate a couple dozen migration files. Sometimes I really tear the schema apart and completely re-do it. This causes the migration process to complain a great deal about defaults and null values and so on. If possible, I would just like to scratch all the migration stuff and re-start the migrations now that I finally know what I'm doing.

Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually

我是研究僧i 提交于 2019-12-28 12:59:45
问题 I am trying to migrate from Django 1.6 to Django 1.8 . I was using South for managing migrations in Django 1.6. I have successfully created new migration files by python manage.py makemigrations . while running python manage.py migrate --fake-initial , I am getting this error Traceback (most recent call last): File "manage.py", line 39, in <module> execute_from_command_line(sys.argv) File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site- packages/django/core/management/__init__.py"

Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually

元气小坏坏 提交于 2019-12-28 12:58:12
问题 I am trying to migrate from Django 1.6 to Django 1.8 . I was using South for managing migrations in Django 1.6. I have successfully created new migration files by python manage.py makemigrations . while running python manage.py migrate --fake-initial , I am getting this error Traceback (most recent call last): File "manage.py", line 39, in <module> execute_from_command_line(sys.argv) File "/home/jonty/.virtualenvs/squadrun/local/lib/python2.7/site- packages/django/core/management/__init__.py"

How do I use Django South when my app is inside another directory?

▼魔方 西西 提交于 2019-12-25 06:39:10
问题 So by default, Django creates apps inside the root project dir. But I moved it inside "apps". py manage.py schemamigration ./apps/chat --initial This doesn't work. Instead of "chat", I put "chat" Inside another directory. 回答1: is apps python module or just directory? if apps python modue, add apps.chat to installed apps in settings.py and run py manage.py schemamigration chat --initial if apps is just directory, so you need to add this directory to your PYTHONPATH. add these lines at near top

Django. South. Can't migrate field: relation already exists

╄→尐↘猪︶ㄣ 提交于 2019-12-25 03:54:34
问题 I've been having lots of problems with South, I just can't add new fields. So this is what I did: dropped the south_migrationhistory table from the database, deleted all the migration folders and uninstalled south "pip uninstall south". then, installed south again. ran syncdb to create the south table on the db. converted_to_south the app where I want to add the fields. (everything working fine till this point) ran schemamigration app --auto. And it gave me the regular message "+added field .

Python South not picking up changes made in add_to_class() method

一个人想着一个人 提交于 2019-12-25 02:53:43
问题 I've added a field to the main Django 'User' model, by inserting a User.add_to_class() to Askbot's models. init the added code is the following: #askbot-devel/askbot/models/__init__.py User.add_to_class('show_active_status', models.BooleanField(default = False)) then I run South's schemamigration $ ./manage.py schemamigration askbot --auto Nothing seems to have changed. As you can see it doesn't pick up the changes. I've checked the database and nothing has changed at all. Additionally, I've