Skip to content

Commit

Permalink
Merge pull request #194 from ponder-lab/ypaing/setting-debug-to-false
Browse files Browse the repository at this point in the history
Ypaing/setting debug to false
  • Loading branch information
y3pio authored Feb 12, 2025
2 parents 1a148b3 + ae2ce86 commit 1d68816
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

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

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Django: 5.1.4
2) Install dependencies: `pip install -r requirements.txt`
3) Ensure database is set up correctly (both remote and local as needed), see instructions below.
4) Run the app: `python manage.py runserver`
5) To enable debugging mode, export env variable: `export DJANGO_DEBUG="True"`
5) Navigate to: `localhost:8000` to view the app.
6) To create an admin account, `python manage.py createsuperuser` and follow instructions to provide account credentials.

Expand Down
49 changes: 25 additions & 24 deletions mysite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
SECRET_KEY = '#f)c)#%(9gcx9d27nh_4#1aghrgo$xqgx!kqzk2-()ccwv1mc3'

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

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

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

# Testing with JawsDB.
DATABASES = {
'default': dj_database_url.config(conn_max_age=600)
}

# Custom DB config.
# DATABASES = {
# # 'default': {
# # 'ENGINE': 'django.db.backends.mysql',
# # 'NAME': 'heroku_4ac11fb2946b4e7',
# # 'USER': 'be05ffb901b132',
# # 'PASSWORD': '3d94000c',
# # 'HOST': 'us-cdbr-east-03.cleardb.com',
# # # 'OPTIONS': {'ssl_mode': 'DISABLED'}
# # 'TEST': {
# # 'MIRROR': 'default',
# # },
# # },
# 'default': {
# 'ENGINE': 'django.db.backends.mysql', # Or other DBs as needed.
# 'NAME': '<LOCAL_DB_DATABASE_NAME>',
# 'USER': '<LOCAL_DB_USER>',
# 'PASSWORD': '<LOCAL_DB_PASSWORD>',
# 'HOST': '127.0.0.1',
# }
# 'default': dj_database_url.config(conn_max_age=600)
# }

# Custom DB config.
DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'heroku_4ac11fb2946b4e7',
# 'USER': 'be05ffb901b132',
# 'PASSWORD': '3d94000c',
# 'HOST': 'us-cdbr-east-03.cleardb.com',
# # 'OPTIONS': {'ssl_mode': 'DISABLED'}
# 'TEST': {
# 'MIRROR': 'default',
# },
# },
'default': {
'ENGINE': 'django.db.backends.mysql', # Or other DBs as needed.
'NAME': 'ponder',
'USER': 'root',
'PASSWORD': 'ponderlab',
'HOST': '127.0.0.1',
}
}


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

0 comments on commit 1d68816

Please sign in to comment.