Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,3 @@ db.sqlite3

# DS_store
.DS_Store
authors/
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ script:
after_success:
- coveralls

env:
- SECRET_KEY='7pgozr2jn7zs_o%i8id6=rddieSECRET_KEY0f0qy3$oy$(8231i^4*@u3'

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn authors.wsgi
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,6 @@ No additional parameters required

`python3 manage.py test --settings=authors.settings.test`

### Application [Staging](https://en.wikipedia.org/wiki/Deployment_environment#Staging) Host Name

`https://authorshaven.herokuapp.com/`
18 changes: 18 additions & 0 deletions authors/apps/authentication/migrations/0002_auto_20180726_1459.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.0.6 on 2018-07-26 14:59

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('authentication', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='user',
name='username',
field=models.CharField(db_index=True, max_length=25, unique=True),
),
]
11 changes: 9 additions & 2 deletions authors/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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 @@ -16,9 +17,9 @@
# 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.getenv('SECRET_KEY')

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['127.0.0.1','localhost','authorshaven.herokuapp.com']

# automaticall append slashes
APPEND_SLASH = True
Expand Down Expand Up @@ -79,6 +80,12 @@
},
]

# using the dj_database_url
# https://stackoverflow.com/questions/16868451/how-to-set-up-database-for-django-app-on-heroku
# https://devcenter.heroku.com/articles/python-concurrency-and-database-connections
# https://stackoverflow.com/questions/27985368/heroku-databases-is-not-defined
DATABASES = { 'default': dj_database_url.config(conn_max_age=600, ssl_require=True) }

WSGI_APPLICATION = 'authors.wsgi.application'

# Password validation
Expand Down
2 changes: 1 addition & 1 deletion authors/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "authors.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "authors.settings.base")

application = get_wsgi_application()
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ certifi==2018.4.16
chardet==3.0.4
coverage==4.5.1
coveralls==1.3.0
dj-database-url==0.5.0
Django==2.0.6
django-cors-middleware==1.3.1
django-coverage==1.2.4
Expand All @@ -12,6 +13,7 @@ django-nose==1.4.5
djangorestframework==3.8.2
djangorestframework-jwt==1.11.0
docopt==0.6.2
gunicorn==19.9.0
idna==2.7
isort==4.3.4
lazy-object-proxy==1.3.1
Expand Down