Static Files still not working on Heroku

I followed all the instructions through the entire video and I don't get any static files on Heroku, so my admin is still unstyled along with the rest of my apps too. Was there something that changed since the release of Django 1.5 that might have made it break?

Sorry You must be a logged in, registered user to answer a question.

Answers

Getting the same problem, static files are not being found (also on django 1.5). Heroku logss:

2013-04-15T19:34:27.936799+00:00 app[web.1]: [15/Apr/2013 14:34:27] "GET / HTTP/1.1" 200 332 2013-04-15T19:34:28.123862+00:00 app[web.1]: [15/Apr/2013 14:34:28] "GET /static/css/bootstrap.min.css HTTP/1.1" 404 102 2013-04-15T19:34:28.125026+00:00 heroku[router]: at=info method=GET path=/static/css/bootstrap.min.css host=glacial-forest-3650.herokuapp.com fwd="84.109.52.135" dyno=web.1 connect=1ms service=7ms status=404 bytes=102

I solved the problem after some trial and error. The settings and url files were OK for me (https://github.com/holandes22/microblog) I was running collectstatic as a separate process in the Procfile. Then tried running manually with 'heroku run python manage.py collect...', didn;t work either. I smashed together the two commands in the Procfile and started working, like this: web: python manage.py collectstatic --noinput --settings=microblog.settings.prod; python manage.py runserver 0.0.0.0:$PORT --noreload --settings=microblog.settings.prod
Pablo Klijnjan on

You said you're using Django 1.5. Something did change, and it does mess with static files:

Django 1.5 introduced ALLOWED_HOSTS:

http://stackoverflow.com/questions/15128135/django-setting-debug-false-causes-500-error

I couldn't get static files to work in Django 1.5 until I added ALLOWED_HOSTS into settings file.

What did you add to ALLOWED_HOSTS ? Or kept it blank?
jz8408 on

Here's a link to my version of the GSWD Repo so far. I think the issue is in the URL pattern for static files. https://github.com/willy1234x1/GSWD

A quick glance and everything looks right. You don't need that static directory, though. It'll be created for you automatically by Heroku. I'll take a deeper look when I can. Do you get anything in the `heroku logs` about your static files?
kennethlove (Staff) on