юг, django 1.2 и ошибка support_transaction - PullRequest
0 голосов
/ 06 марта 2012

Я пытаюсь заставить работать юг, но постоянно получаю ошибки.Я даже строго следую инструкциям.

, поэтому я делаю простую модель Найта и запускаю syncdb с югом в APPS, но не sth (тестовое приложение).

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
#    'whatever.sth',
    'south',
#    'sth',
)

Я удаляю комментарий из 'sth', и запустите:

user@pc:~/projectdir/whatever$ python manage.py schemamigration sth --initial
Creating migrations directory at '/pathtoproject/whatever/sth/migrations'...
Creating __init__.py in '/pathtoproject/whatever/sth/migrations'...
 + Added model sth.Knight
Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate sth

и теперь миграция:

user@pc:~/pathtoproject/whatever$ python manage.py migrate sth
Running migrations for sth:
  - Migrating forwards to 0001_initial.
 > sth:0001_initial
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/pymodules/python2.7/south/south/management/commands/migrate.py", line 107, in handle
    ignore_ghosts = ignore_ghosts,
  File "/usr/lib/pymodules/python2.7/south/south/migration/__init__.py", line 219, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/usr/lib/pymodules/python2.7/south/south/migration/migrators.py", line 235, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/usr/lib/pymodules/python2.7/south/south/migration/migrators.py", line 310, in migrate_many
    result = self.migrate(migration, database)
  File "/usr/lib/pymodules/python2.7/south/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration)
  File "/usr/lib/pymodules/python2.7/south/south/migration/migrators.py", line 104, in run
    if not south.db.db.has_ddl_transactions:
  File "/usr/lib/pymodules/python2.7/south/south/db/generic.py", line 29, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
  File "/usr/lib/pymodules/python2.7/south/south/db/generic.py", line 110, in has_ddl_transactions
    if connection.features.supports_transactions:
AttributeError: 'DatabaseFeatures' object has no attribute 'supports_transactions'

мои настройки базы данных в settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '/pathtoproject/whatever/db',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

любой может сказать мне, чтонеправильно?

1 Ответ

0 голосов
/ 06 марта 2012

"Эта ошибка была исправлена ​​в разрабатываемой версии South, которую можно использовать, установив

"pip install -U South==dev"

(и это происходит только с Django 1.2 и ниже)

Andrew "

Ответ, который я получил из списка рассылки на юг. Работает как шарм. Публикуйте здесь как ответ, чтобы легче было найти решение для других.

...