I have a Django app running on Heroku/Cedar, configured as per the instructions at https://devcenter.heroku.com/articles/django
Using gunicorn as per Heroku\'s instr
just add these instead
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()
using django 1.4.1
create 'static' folder into your 'project_directory'.
set the 'STATIC_ROOT' path in 'settings.py' file which can serve your admin-site's static files.
STATIC_ROOT = (os.path.join(os.path.dirname(__file__), '..', 'static'))
Add STATIC_ROOT in '/urls.py'
from django.conf import settings
urlpatterns += patterns('',
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.STATIC_ROOT,
}),
)
Run the following command that will copy all the admin static files into project's static folder.
python manage.py collectstatic
Now do git add, commit and push heroku master.
If you are deploying to Heroku without using whitenoise (which I would suggest), definitely use dj_static https://pypi.python.org/pypi/dj-static!
I spent the past 3 hours trying to serve my files to heroku and dj_static worked within a matter of 2 minutes.