The django.db.backends.postgresql_psycopg2 module is deprecated in favor of django.db.backends.postgresql. It’s been an alias since Django 1.9

This commit is contained in:
trhr 2020-02-09 19:58:21 -06:00
parent 090157979b
commit ce0a012e51
5 changed files with 5 additions and 5 deletions

View file

@ -40,7 +40,7 @@ SERVERNAME = "testing_mygame"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"ENGINE": "django.db.backends.postgresql",
"NAME": "evennia",
"USER": "evennia",
"PASSWORD": "password",

View file

@ -245,7 +245,7 @@ IN_GAME_ERRORS = True
# ENGINE - path to the the database backend. Possible choices are:
# 'django.db.backends.sqlite3', (default)
# 'django.db.backends.mysql',
# 'django.db.backends.postgresql_psycopg2',
# 'django.db.backends.postgresql',
# 'django.db.backends.oracle' (untested).
# NAME - database name, or path to the db file for sqlite3
# USER - db admin (unused in sqlite3)

View file

@ -27,7 +27,7 @@ def _drop_table(db_cursor, table_name):
db_cursor.execute("SET FOREIGN_KEY_CHECKS=0;")
db_cursor.execute("DROP TABLE {table};".format(table=table_name))
db_cursor.execute("SET FOREIGN_KEY_CHECKS=1;")
elif _ENGINE == "postgresql_psycopg2":
elif _ENGINE == "postgresql":
db_cursor.execute("ALTER TABLE {table} DISABLE TRIGGER ALL;".format(table=table_name))
db_cursor.execute("DROP TABLE {table};".format(table=table_name))
db_cursor.execute("ALTER TABLE {table} ENABLE TRIGGER ALL;".format(table=table_name))

View file

@ -268,7 +268,7 @@ class PickledObjectField(models.Field):
"""
if value is not None and not isinstance(value, PickledObject):
# We call force_str here explicitly, so that the encoded string
# isn't rejected by the postgresql_psycopg2 backend. Alternatively,
# isn't rejected by the postgresql backend. Alternatively,
# we could have just registered PickledObject with the psycopg
# marshaller (telling it to store it like it would a string), but
# since both of these methods result in the same value being stored,

View file

@ -1036,7 +1036,7 @@ def uses_database(name="sqlite3"):
shortcut to having to use the full backend name.
Args:
name (str): One of 'sqlite3', 'mysql', 'postgresql_psycopg2'
name (str): One of 'sqlite3', 'mysql', 'postgresql'
or 'oracle'.
Returns: