Skip to content

Commit 7e6392c

Browse files
committed
Updated: db for vercel
1 parent b5bd502 commit 7e6392c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/backend/db.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
from backend.env import config
12
from backend.settings.base import BASE_DIR
23

4+
DJANGO_VERCEL = config("DJANGO_VERCEL", default=True, cast=bool)
5+
36
# Database
47
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
58

6-
7-
DATABASES = {
8-
"default": {
9-
"ENGINE": "django.db.backends.sqlite3",
10-
"NAME": BASE_DIR / "db.sqlite3",
9+
if DJANGO_VERCEL:
10+
DATABASES = {}
11+
else:
12+
DATABASES = {
13+
"default": {
14+
"ENGINE": "django.db.backends.sqlite3",
15+
"NAME": BASE_DIR / "db.sqlite3",
16+
}
1117
}
12-
}

0 commit comments

Comments
 (0)