我已经使用python一段时间了,但是从未使用过django。我要接管另一个员工在离开我们公司之前所做的项目。我想知道在选项postgresql和postgresql_psycopg2作为django的数据库驱动程序之间是否有区别。
在有关如何设置Django项目的一些文章和文档中,我仅看到了postgresql,而在others中,我看到了postgresql_psycopg2。我在提到psycopg2的文档(here或here)中找不到任何内容,所以这只是编写该选项的旧方法吗?
一个只是另一个的别名,还是它们实际上是不同的?我也找不到关于此的任何其他问题。
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',# here I also saw postgres_psycopg2
'NAME': 'premqcsite',
'USER': 'django_user',
'PASSWORD': 'Encepta_123',
'HOST': 'localhost',
'PORT': '5432',
}}
最佳答案
一样的。 django django.db.backends.postgresql_psycopg2,在django 1.9中将其重命名为django.db.backends.postgresql
。
从文档:
关于python - postgres和postgresql_psycopg2作为django的数据库引擎有什么区别?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47946856/