@ -0,0 +1 @@ | |||||
web: gunicorn hc.wsgi --log-file - |
@ -0,0 +1,34 @@ | |||||
{ | |||||
"name": "healthchecks", | |||||
"website": "https://github.com/healthchecks/healthchecks", | |||||
"keywords": ["heroku", "cron", "devops", "python", "monitoring", "cron-jobs"], | |||||
"image": "heroku/python", | |||||
"addons": [ | |||||
"heroku-postgresql:hobby-dev", | |||||
"mailgun:starter", | |||||
"scheduler:standard" | |||||
], | |||||
"scripts": { | |||||
"postdeploy": "python manage.py migrate" | |||||
}, | |||||
"env": { | |||||
"SITE_ROOT": { | |||||
"description": "Used to build fully qualified URLs for pings, and for use in emails and notifications. Enter your App Name defined above here.", | |||||
"value": "https://appname.herokuapp.com/" | |||||
}, | |||||
"SITE_NAME": { | |||||
"description": "Used throughout the templates.", | |||||
"value": "My Monitoring Project" | |||||
}, | |||||
"FROM_EMAIL": { | |||||
"description": "Email from address.", | |||||
"value": "[email protected]" | |||||
}, | |||||
"SECRET_KEY": { | |||||
"generator": "secret" | |||||
}, | |||||
"ON_HEROKU": { | |||||
"value": "yes" | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,36 @@ | |||||
#!/usr/bin/env bash | |||||
set -eo pipefail | |||||
# The post_compile hook is run by heroku-buildpack-python | |||||
echo "-----> I'm post-compile hook" | |||||
# Work around Heroku bug whereby pylibmc isn't available during | |||||
# compile phase. See: https://github.com/heroku/heroku-buildpack-python/issues/57 | |||||
export MEMCACHE_SERVERS='' MEMCACHIER_SERVERS='' | |||||
if [ -f bin/install_nodejs ]; then | |||||
echo "-----> Running install_nodejs" | |||||
chmod +x bin/install_nodejs | |||||
bin/install_nodejs | |||||
if [ -f bin/install_less ]; then | |||||
echo "-----> Running install_lessc" | |||||
chmod +x bin/install_less | |||||
bin/install_less | |||||
fi | |||||
fi | |||||
if [ -f bin/run_collectstatic ]; then | |||||
echo "-----> Running run_collectstatic" | |||||
chmod +x bin/run_collectstatic | |||||
bin/run_collectstatic | |||||
fi | |||||
if [ -f bin/run_compress ]; then | |||||
echo "-----> Running run_compress" | |||||
chmod +x bin/run_compress | |||||
bin/run_compress | |||||
fi | |||||
echo "-----> Post-compile done" |
@ -0,0 +1,15 @@ | |||||
#!/usr/bin/env bash | |||||
set -eo pipefail | |||||
indent() { | |||||
RE="s/^/ /" | |||||
[ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE" | |||||
} | |||||
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1) | |||||
MANAGE_FILE=${MANAGE_FILE:2} | |||||
echo "-----> Compressing static files" | |||||
python $MANAGE_FILE compress 2>&1 | indent | |||||
echo |
@ -0,0 +1,57 @@ | |||||
import os | |||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |||||
SITE_ROOT = os.getenv('SITE_ROOT', "https://my-monitoring-project.com") | |||||
SITE_NAME = os.getenv('SITE_NAME', "My Monitoring Project") | |||||
DEFAULT_FROM_EMAIL = os.getenv('FROM_EMAIL', "[email protected]") | |||||
import herokuify | |||||
from herokuify.common import * | |||||
from herokuify.mail.mailgun import * | |||||
DATABASES = herokuify.get_db_config() | |||||
DEBUG = False | |||||
SECRET_KEY = os.getenv('SECRET_KEY', "---") | |||||
# Allow all host headers | |||||
ALLOWED_HOSTS = ['*'] | |||||
# Simplified static file serving. | |||||
# https://warehouse.python.org/project/whitenoise/ | |||||
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' | |||||
import sys | |||||
LOGGING = { | |||||
'version': 1, | |||||
'disable_existing_loggers': False, | |||||
'formatters': { | |||||
'verbose': { | |||||
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", | |||||
'datefmt' : "%d/%b/%Y %H:%M:%S" | |||||
}, | |||||
'simple': { | |||||
'format': '%(levelname)s %(message)s' | |||||
}, | |||||
}, | |||||
'handlers': { | |||||
'console': { | |||||
'level': 'DEBUG', | |||||
'class': 'logging.StreamHandler', | |||||
'formatter': 'verbose', | |||||
'stream': sys.stdout, | |||||
}, | |||||
}, | |||||
'loggers': { | |||||
'django': { | |||||
'handlers':['console'], | |||||
'propagate': True, | |||||
'level':'DEBUG', | |||||
}, | |||||
'MYAPP': { | |||||
'handlers': ['console'], | |||||
'level': 'DEBUG', | |||||
}, | |||||
} | |||||
} |
@ -0,0 +1,9 @@ | |||||
croniter | |||||
Django | |||||
django_compressor | |||||
psycopg2 | |||||
pytz | |||||
requests | |||||
gunicorn | |||||
whitenoise | |||||
django-herokuify |
@ -1,6 +1,28 @@ | |||||
croniter | |||||
Django==1.10.5 | |||||
django_compressor==2.1 | |||||
# | |||||
# This file is autogenerated by pip-compile | |||||
# To update, run: | |||||
# | |||||
# pip-compile --output-file requirements.txt requirements.in | |||||
# | |||||
boto==2.46.1 # via django-herokuify | |||||
croniter==0.3.15 | |||||
dj-database-url==0.4.2 # via django-heroku-postgresify, django-herokuify | |||||
django-appconf==1.0.2 # via django-compressor | |||||
django-compressor==2.1.1 | |||||
django-heroku-memcacheify==1.0.0 # via django-herokuify | |||||
django-heroku-postgresify==0.4 # via django-herokuify | |||||
django-herokuify==1.0rc3 | |||||
django-pylibmc-sasl==0.2.4 # via django-herokuify | |||||
django-pylibmc==0.6.1 # via django-heroku-memcacheify | |||||
django-storages==1.5.2 # via django-herokuify | |||||
Django==1.10.5 # via django-heroku-postgresify, django-pylibmc-sasl | |||||
gunicorn==19.6.0 | |||||
psycopg2==2.6.2 | psycopg2==2.6.2 | ||||
pytz==2016.7 | |||||
requests==2.9.1 | |||||
pylibmc==1.5.1 # via django-herokuify, django-pylibmc, django-pylibmc-sasl | |||||
python-dateutil==2.6.0 # via croniter | |||||
pytz==2016.10 | |||||
rcssmin==1.0.6 # via django-compressor | |||||
requests==2.13.0 | |||||
rjsmin==1.0.12 # via django-compressor | |||||
six==1.10.0 # via python-dateutil | |||||
whitenoise==3.3.0 |