Skip to content

Commit a2c2dc3

Browse files
committed
really allow POD_INSTANCE to be none for backward compatibility
1 parent 2811438 commit a2c2dc3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pod/main/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
import os
8+
INSTANCE = os.getenv("POD_INSTANCE", None)
89

910
##
1011
# flatpages
@@ -80,7 +81,7 @@
8081
# to be used with Django.
8182
#
8283
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
83-
default_db = "db.{instance}.sqlite3".format(instance=os.environ["POD_INSTANCE"]) if os.getenv("POD_INSTANCE") else "db.sqlite3"
84+
default_db = f"db.{INSTANCE}.sqlite3" if INSTANCE else "db.sqlite3"
8485
DATABASES = {
8586
"default": {
8687
"ENGINE": "django.db.backends.sqlite3",

0 commit comments

Comments
 (0)