heroku-python / dj-static

DEPRECATED - use WhiteNoise instead!
http://kennethreitz.org/introducing-dj-static/
BSD 2-Clause "Simplified" License
511 stars 74 forks source link

dj-static works with runserver but not gunicorn? #23

Closed mflaxman closed 10 years ago

mflaxman commented 10 years ago

I've been trying to get dj-static to work on my site but for some reason it doesn't seem to work with gunicorn. This can't be (that's the whole point of dj-static!) and I was sure it was PEBCAK, so I created a brand new hellodjango app following the instructions here to be sure it wasn't something in my code.

Steps to reproduce:

Now, run foreman run python manage.py runserver and visit http://127.0.0.1:8000/static/test.txt and see SUCCESS. Looking good so far! Kill that and run gunicorn foreman run gunicorn hellodjango.wsgi and visit http://127.0.0.1:8000/static/test.txt and see a 'Page not found (404)' error. If you visit http://127.0.0.1:8000 instead you'll see that gunicorn does work, just not for static content.

How can this be? What am I doing wrong?

Thanks!

Also, one uber-weird note: if I set DEBUG and TEMPLATE_DEBUG to False. Then I get a 404 page using both runserver and gunicorn. Perhaps this is the same thing happening in issue #11?

mflaxman commented 10 years ago

My wsgi.py ws incorrect (it wasn't using Cling) and that's what was causing the problems. Closing.