Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit c2eaa38

Browse files
committed
Only use the env file for development
1 parent b629594 commit c2eaa38

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: .env renamed to .env.dev

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# This is a test .env file. These secrets are NOT used in production.
22
DJANGO_SECRET_KEY=secret
3-
DJANGO_DEBUG=True
43
POSTGRES_PASSWORD=postgres

Diff for: app/settings.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@
2222
# Quick-start development settings - unsuitable for production
2323
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
2424

25+
DEBUG = os.getenv("DJANGO_DEBUG") == "True"
26+
27+
if DEBUG:
28+
load_dotenv(BASE_DIR / ".env.dev")
29+
else:
30+
load_dotenv()
31+
2532
# SECURITY WARNING: keep the secret key used in production secret!
26-
load_dotenv()
2733
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")
2834

29-
# SECURITY WARNING: don't run with debug turned on in production!
30-
DEBUG = True
3135

3236
ALLOWED_HOSTS = ["lantern.khoj.dev", "localhost"]
3337

Diff for: docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
build: .
1313
environment:
1414
- POSTGRES_HOST=lantern-db
15+
- DJANGO_DEBUG=True
1516
ports:
1617
- "5000:5000"
1718
volumes:

0 commit comments

Comments
 (0)