Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何管理django';通过aws红移的orm?_Python_Django_Amazon Redshift - Fatal编程技术网

Python 如何管理django';通过aws红移的orm?

Python 如何管理django';通过aws红移的orm?,python,django,amazon-redshift,Python,Django,Amazon Redshift,我是AWS redshift的新开发人员 据我所知,AWS红移与postgresql非常相似 redshift和Django之间是否有用于管理(如自动迁移、自动迁移)的库或模块 我确实使用SQLAlchemy和redshift创建了一个表并访问了数据,但我不知道如何在PythonDjango中做到这一点 任何建议或想法都可以 我用这个命令得到了这个错误 python manage.py migrate django.db.migrations.exceptions.MigrationSche

我是AWS redshift的新开发人员

据我所知,AWS红移与postgresql非常相似

redshift和Django之间是否有用于管理(如自动迁移、自动迁移)的库或模块

我确实使用SQLAlchemy和redshift创建了一个表并访问了数据,但我不知道如何在PythonDjango中做到这一点

任何建议或想法都可以

我用这个命令得到了这个错误

python manage.py migrate


django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table (Column "django_migrations.id" has unsupported type "serial".

您可以轻松地将红移服务与Django应用程序连接起来

尝试将下面的代码添加到
settings.py
文件中

DATABASES = {
    'default': {
        'NAME': '[Your Cluster Name]',
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'USER': '[Username ]',
        'PASSWORD': '[Password]',
        'HOST': '[Pathname]',
        'PORT': 5439,
    },
}
但是,您需要知道红移不会强制主键。在我看来,在Django应用程序中使用红移作为默认数据库不是一个好主意,因为红移对于数据仓库而不是应用程序来说是一个有用的数据库


总而言之,我的建议是PostgreSQL

我想知道的是,如果连接像您的建议一样,django'orm将支持完整的功能,比如(python manage.py makemigrations…?@user3773632,当然可以。如果您在访问所有Django的ORM之前连接了前面提到的DB。