Update settings.py
This commit is contained in:
parent
f0bfd7affa
commit
bd73794620
20
settings.py
20
settings.py
@ -81,22 +81,16 @@ TEMPLATES = [
|
|||||||
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
|
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
"default": {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
"ENGINE": os.environ.get("DB_ENGINE"),
|
||||||
"NAME": os.path.join(BASE_DIR, os.environ.get("DB")),
|
"NAME": os.environ.get("DB_NAME"),
|
||||||
|
"USER": os.environ.get("DB_USER"),
|
||||||
|
"PASSWORD": os.environ.get("DB_PASSWORD"),
|
||||||
|
"HOST": os.environ.get("DB_HOST"),
|
||||||
|
"PORT": os.environ.get("DB_PORT"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def init_command_sqlite(sender, connection, **kwargs):
|
|
||||||
"""Enable initial config sqlite."""
|
|
||||||
if connection.vendor == "sqlite":
|
|
||||||
cursor = connection.cursor()
|
|
||||||
cursor.execute("PRAGMA locking_mode=exclusive;")
|
|
||||||
cursor.execute("PRAGMA journal_mode=wal;")
|
|
||||||
cursor.execute("PRAGMA synchronous=full;")
|
|
||||||
|
|
||||||
connection_created.connect(init_command_sqlite)
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user