Skip to content

Commit

Permalink
Merge 82bf509 into e4457fe
Browse files Browse the repository at this point in the history
  • Loading branch information
sekayasin committed Nov 30, 2018
2 parents e4457fe + 82bf509 commit 84407fa
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,6 @@ db.sqlite3

# IDE
.vscode/

# Django Stuff
migrations/
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ language: python
python:
- "3.6"

services:
- postgresql

before_script:
- psql -c 'create database ah_zeus_db;' -U postgres

install:
- pip install -r requirements.txt

Expand Down
18 changes: 14 additions & 4 deletions authors/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import os
import dj_database_url

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand All @@ -19,10 +20,10 @@
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '7pgozr2jn7zs_o%i8id6=rddie!*0f0qy3$oy$(8231i^4*@u3'
SECRET_KEY = os.environ.get('PROD_SECRET_KEY','7pgozr2jn7zs_o%i8id6=rddie!*0f0qy3$oy$(8231i^4*@u3')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = bool(os.environ.get('PROD_DEBUG', True))

ALLOWED_HOSTS = []

Expand Down Expand Up @@ -80,11 +81,20 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get("DB_NAME", 'ah_zeus_db'),
'USER': os.environ.get("DB_USER", 'postgres'),
'PASSWORD': os.environ.get("DB_PASS", ''),
'HOST': os.environ.get("DB_HOST", '127.0.0.1'),
'PORT': os.environ.get("DB_PORT", '5432'),
}
}

# Heroku $DATABASE_URL - update database configuration
heroku_db_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(heroku_db_env)


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

Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ certifi==2018.10.15
chardet==3.0.4
coverage==4.5.2
coveralls==1.5.1
dj-database-url==0.5.0
Django==2.1
django-cors-headers==2.4.0
django-cors-middleware==1.3.1
Expand All @@ -13,6 +14,10 @@ idna==2.7
isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
psycopg2-binary==2.7.6.1
PyJWT==1.4.2
pylint==2.2.1
pytz==2018.7
Expand Down

0 comments on commit 84407fa

Please sign in to comment.