django 1.8连接到redshift:django.db.utils.NotSupportedError:Column" django_migrations.id"有不支持的类型" serial"

时间:2015-12-03 13:59:35

标签: python django amazon-web-services amazon-redshift

我尝试使用我的django应用程序连接到Amazon Redshift数据库。在我的settings.py中,我有这样的设置:

DATABASES = {
    "default": {},
    'redshift': {
        'NAME': 'xxxx',
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'USER': 'xxxx',
        'PASSWORD': 'xxxxxx',
        'HOST': 'xxxx.xxxx.eu-west-1.redshift.amazonaws.com',
        'PORT': 5439,
    }
}

当我尝试运行我的应用程序时,我收到此错误:

Traceback (most recent call last):
   File "manage.py", line 12, in <module>
     execute_from_command_line(sys.argv)
  File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/core/management/__init__.py", line 346, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/core/management/base.py", line 394, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/core/management/base.py", line 445, in execute
     output = self.handle(*args, **options)
  File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
  File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
  File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/migrations/loader.py", line 188, in build_graph
self.applied_migrations = recorder.applied_migrations()
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
  File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/migrations/recorder.py", line 53, in ensure_schema
editor.create_model(self.Migration)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 286, in create_model
self.execute(sql, params or None)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 111, in execute
cursor.execute(sql, params)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/utils.py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/utils/six.py", line 658, in reraise
raise value.with_traceback(tb)
   File "/Users/stevengerrits/anaconda/envs/djangoweb/lib/python3.4/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
 django.db.utils.NotSupportedError: Column "django_migrations.id" has unsupported type "serial".

我用谷歌搜索它,但似乎django不是一个使用redshift的好框架,是真的吗?

0 个答案:

没有答案