From 80096d72e4bc4b1c9375cf25f72c7eed49e00251 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 27 May 2015 22:19:18 +0200 Subject: [PATCH] Add Heroku support --- .gitignore | 1 + Procfile | 1 + duckbook/settings.py | 1 + duckbook/urls.py | 6 ++++++ 4 files changed, 9 insertions(+) create mode 100644 Procfile diff --git a/.gitignore b/.gitignore index 96a831a..462f96c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ *.pyc /db.sqlite3 /venv/ +/static/ /.coverage /htmlcov/ diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..2d52147 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn duckbook.wsgi --log-file=- \ No newline at end of file diff --git a/duckbook/settings.py b/duckbook/settings.py index 15a774e..8766ea5 100644 --- a/duckbook/settings.py +++ b/duckbook/settings.py @@ -85,6 +85,7 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.7/howto/static-files/ STATIC_URL = '/static/' +STATIC_ROOT = 'static' MAX_DUCK_LEVEL = 5 COMP_WARN_LEVEL = 2 diff --git a/duckbook/urls.py b/duckbook/urls.py index c6c24b3..d7cf217 100644 --- a/duckbook/urls.py +++ b/duckbook/urls.py @@ -1,10 +1,16 @@ from django.conf.urls import patterns, include, url from django.contrib import admin +from django.conf import settings admin.autodiscover() urlpatterns = patterns( '', + url( + r'^static/(?P.*)$', + 'django.views.static.serve', + {'document_root': settings.STATIC_ROOT} + ), url(r'^admin/', include(admin.site.urls)), url(r'^accounts/', include('accounts.urls', namespace = 'accounts')), url(r'^api/', include('api.urls', namespace = 'api')),