Add Heroku config files.

This commit is contained in:
Christopher Charbonneau Wells 2017-10-23 04:49:10 -04:00
parent ae959205d9
commit 909c391451
6 changed files with 98 additions and 16 deletions

View File

@ -9,9 +9,11 @@ django-filter = "*"
django-widget-tweaks = "*" django-widget-tweaks = "*"
plotly = "*" plotly = "*"
pandas = "*" pandas = "*"
faker = "*"
dj-database-url = "*"
gunicorn = "*"
[dev-packages] [dev-packages]
coveralls = "*" coveralls = "*"
faker = "*"
flake8 = "*" flake8 = "*"
ipaddress = "*" ipaddress = "*"

26
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "6320081dc17e4c796cda43fc5a5bef12a154917fc572a75a5444e78454385e12" "sha256": "52db700b9c061baeb935565e2910f5205547ba93306d53f12634b7a0a4c3cb02"
}, },
"requires": {}, "requires": {},
"sources": [ "sources": [
@ -21,6 +21,9 @@
"decorator": { "decorator": {
"version": "==4.1.2" "version": "==4.1.2"
}, },
"dj-database-url": {
"version": "==0.4.2"
},
"django": { "django": {
"version": "==1.11.6" "version": "==1.11.6"
}, },
@ -33,6 +36,12 @@
"djangorestframework": { "djangorestframework": {
"version": "==3.7.1" "version": "==3.7.1"
}, },
"faker": {
"version": "==0.8.6"
},
"gunicorn": {
"version": "==19.7.1"
},
"idna": { "idna": {
"version": "==2.6" "version": "==2.6"
}, },
@ -69,6 +78,9 @@
"six": { "six": {
"version": "==1.11.0" "version": "==1.11.0"
}, },
"text-unidecode": {
"version": "==1.0"
},
"traitlets": { "traitlets": {
"version": "==4.3.2" "version": "==4.3.2"
}, },
@ -92,9 +104,6 @@
"docopt": { "docopt": {
"version": "==0.6.2" "version": "==0.6.2"
}, },
"faker": {
"version": "==0.8.6"
},
"flake8": { "flake8": {
"version": "==3.4.1" "version": "==3.4.1"
}, },
@ -113,18 +122,9 @@
"pyflakes": { "pyflakes": {
"version": "==1.5.0" "version": "==1.5.0"
}, },
"python-dateutil": {
"version": "==2.6.1"
},
"requests": { "requests": {
"version": "==2.18.4" "version": "==2.18.4"
}, },
"six": {
"version": "==1.11.0"
},
"text-unidecode": {
"version": "==1.0"
},
"urllib3": { "urllib3": {
"version": "==1.22" "version": "==1.22"
} }

View File

@ -5,7 +5,7 @@
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause) [![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
A buddy for babies! Helps caregivers track sleep, feedings, diaper changes, and A buddy for babies! Helps caregivers track sleep, feedings, diaper changes, and
tummy time to learn about and predict baby's needs without all the guess work. tummy time to learn about and predict baby's needs without (as much) guess work.
## Development ## Development

40
app.json Normal file
View File

@ -0,0 +1,40 @@
{
"name": "Baby Buddy",
"author": "Baby Buddy's Contributors",
"description": "A buddy for babies! Helps caregivers track sleep, feedings, diaper changes, and tummy time to learn about and predict baby's needs without (as much) guess work.",
"repository": "https://github.com/cdubz/babybuddy",
"keywords": [
"baby",
"infant",
"newborn",
"baby tracking",
"baby buddy",
"python",
"django",
"web",
"self-host"
],
"version": "0.1.0",
"license": "BSD-2-Clause",
"buildpacks": [
{
"url": "heroku/nodejs"
},
{
"url": "heroku/python"
}
],
"env": {
"DJANGO_SETTINGS_MODULE": {
"description": "We have a prebuilt config for Heroku",
"value": "babybuddy.settings.heroku"
},
"SECRET_KEY": {
"description": "Used for the Django auth system",
"generator": "secret"
}
},
"scripts": {
"postdeploy": "python manage.py migrate"
}
}

View File

@ -0,0 +1,39 @@
import os
import dj_database_url
from .base import * # noqa: F401,F403
DEBUG = False
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ['SECRET_KEY']
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': dj_database_url.config(conn_max_age=500)
}
# Email
SENDGRID_USERNAME = os.environ.get('SENDGRID_USERNAME', None) # noqa: F405
SENDGRID_PASSWORD = os.environ.get('SENDGRID_PASSWORD', None) # noqa: F405
# Use SendGrid if we have the addon installed, else just print to console which
# is accessible via Heroku logs
if SENDGRID_USERNAME and SENDGRID_PASSWORD:
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = SENDGRID_USERNAME
EMAIL_HOST_PASSWORD = SENDGRID_PASSWORD
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_TIMEOUT = 60
else:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

View File

@ -15,7 +15,8 @@
"baby buddy", "baby buddy",
"python", "python",
"django", "django",
"web" "web",
"self-host"
], ],
"dependencies": { "dependencies": {
"bootstrap": "^4.0.0-beta.2", "bootstrap": "^4.0.0-beta.2",