Skip to content

Commit 1d68816

Browse files
authored
Merge pull request #194 from ponder-lab/ypaing/setting-debug-to-false
Ypaing/setting debug to false
2 parents 1a148b3 + ae2ce86 commit 1d68816

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
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

+25-24
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 = True # 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

@@ -91,32 +92,32 @@
9192
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
9293

9394
# Testing with JawsDB.
94-
DATABASES = {
95-
'default': dj_database_url.config(conn_max_age=600)
96-
}
97-
98-
# Custom DB config.
9995
# DATABASES = {
100-
# # 'default': {
101-
# # 'ENGINE': 'django.db.backends.mysql',
102-
# # 'NAME': 'heroku_4ac11fb2946b4e7',
103-
# # 'USER': 'be05ffb901b132',
104-
# # 'PASSWORD': '3d94000c',
105-
# # 'HOST': 'us-cdbr-east-03.cleardb.com',
106-
# # # 'OPTIONS': {'ssl_mode': 'DISABLED'}
107-
# # 'TEST': {
108-
# # 'MIRROR': 'default',
109-
# # },
110-
# # },
111-
# 'default': {
112-
# 'ENGINE': 'django.db.backends.mysql', # Or other DBs as needed.
113-
# 'NAME': '<LOCAL_DB_DATABASE_NAME>',
114-
# 'USER': '<LOCAL_DB_USER>',
115-
# 'PASSWORD': '<LOCAL_DB_PASSWORD>',
116-
# 'HOST': '127.0.0.1',
117-
# }
96+
# 'default': dj_database_url.config(conn_max_age=600)
11897
# }
11998

99+
# Custom DB config.
100+
DATABASES = {
101+
# 'default': {
102+
# 'ENGINE': 'django.db.backends.mysql',
103+
# 'NAME': 'heroku_4ac11fb2946b4e7',
104+
# 'USER': 'be05ffb901b132',
105+
# 'PASSWORD': '3d94000c',
106+
# 'HOST': 'us-cdbr-east-03.cleardb.com',
107+
# # 'OPTIONS': {'ssl_mode': 'DISABLED'}
108+
# 'TEST': {
109+
# 'MIRROR': 'default',
110+
# },
111+
# },
112+
'default': {
113+
'ENGINE': 'django.db.backends.mysql', # Or other DBs as needed.
114+
'NAME': 'ponder',
115+
'USER': 'root',
116+
'PASSWORD': 'ponderlab',
117+
'HOST': '127.0.0.1',
118+
}
119+
}
120+
120121

121122
# Password validation
122123
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators

0 commit comments

Comments
 (0)