Created
January 16, 2013 17:05
-
-
Save maxparm/4548843 to your computer and use it in GitHub Desktop.
Django: serve static files on Heroku cedar stack 1) Make sure files are matching with following
2) Create a /static/ directory and add it to git (make sure it is added, this will trigger collect static command from heroku)
3) Make sure to have gunicorn in requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: python manage.py runserver 0.0.0.0:$PORT --noreload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Django==1.4.3 | |
South==0.7.6 | |
distribute==0.6.27 | |
dj-database-url==0.2.1 | |
psycopg2==2.4.6 | |
wsgiref==0.1.2 | |
gunicorn==0.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MEDIA_URL = '/media/' | |
STATIC_ROOT = '' | |
STATIC_URL = '/static/' | |
STATICFILES_DIRS = ( | |
os.path.join(os.path.abspath(os.path.dirname(__file__) + '/..'), 'static'), | |
) | |
STATICFILES_FINDERS = ( | |
'django.contrib.staticfiles.finders.FileSystemFinder', | |
'django.contrib.staticfiles.finders.AppDirectoriesFinder', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import patterns, include, url | |
from django.conf import settings | |
# Uncomment the next two lines to enable the admin: | |
from django.contrib import admin | |
admin.autodiscover() | |
urlpatterns = patterns('', | |
# Home: | |
url(r'^$', 'home.views.home', name='home'), | |