diff --git a/Procfile b/Procfile index ff40e1551306a6076323efc15ed0b1101b9b355e..60b0579cd2f010e3cce98dabf146f40b5fd5eed7 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -web: gunicorn wsgi:application +web: gunicorn wsgi:application -b 0.0.0.0:$PORT -w 8 worker: python manage.py celeryd -E -B --beat \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index c19cef7479a3fdf6f1fd1a6d00be2bea98556bed..952a2d5b8629b9cf79ccaa6e92afca5c53f40f7b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,3 +17,4 @@ dj_database_url==0.2.2 django-sslify==0.2 django_webtest==1.7.5 webtest==2.0.7 +django-db-pool==0.0.10 diff --git a/settings.py b/settings.py index 8df98060ac7dd53a138867aa08c256416232f694..c7e9ea25f7943de65cc26d41d64733533c27f407 100644 --- a/settings.py +++ b/settings.py @@ -28,6 +28,8 @@ DATABASES = { if get_from_env('DATABASE_URL', None): import dj_database_url DATABASES['default'] = dj_database_url.config() + DATABASES['default']['ENGINE'] = 'dbpool.db.backends.postgresql_psycopg2' + DATABASES['default']['OPTIONS'] = {'MAX_CONNS': 1} # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name