Skip to content

Commit ae2ce86

Browse files
committed
defaulting debug settings to fals for production
1 parent 2eb93ee commit ae2ce86

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.github/workflows/django.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515

1616
env:
1717
DATABASE_URL: mysql://dace5c60l5ctt7og:qrmu7nb4hbzjbp0z@r1bsyfx4gbowdsis.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/uoq6lb032iusvpqz
18+
DJANGO_DEBUG: 'False'
1819

1920
jobs:
2021
build:

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Django: 5.1.4
2424
2) Install dependencies: `pip install -r requirements.txt`
2525
3) Ensure database is set up correctly (both remote and local as needed), see instructions below.
2626
4) Run the app: `python manage.py runserver`
27+
5) To enable debugging mode, export env variable: `export DJANGO_DEBUG="True"`
2728
5) Navigate to: `localhost:8000` to view the app.
2829
6) To create an admin account, `python manage.py createsuperuser` and follow instructions to provide account credentials.
2930

mysite/settings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
SECRET_KEY = '#f)c)#%(9gcx9d27nh_4#1aghrgo$xqgx!kqzk2-()ccwv1mc3'
3030

3131
# SECURITY WARNING: don't run with debug turned on in production!
32-
DEBUG = False # We are currently in dev per #16.
32+
# Set using DJANGO_DEBUG env variable, defaults to False if not set. Set to 'True' to enable.
33+
DEBUG = os.getenv('DJANGO_DEBUG', 'False') == 'True'
3334

3435
ALLOWED_HOSTS = ['tranquil-anchorage-16644-bbe77c4a9151.herokuapp.com', 'localhost']
3536

0 commit comments

Comments
 (0)