heroku-python / dj-static

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

When starting django server out of the root path, statics paths can fail #45

Open rsm-gh opened 9 years ago

rsm-gh commented 9 years ago

I managed to find/solve my problem, but I still wanted to ask in case some one have the same problem. I also would like to know if this is a normal behaviour! (I'm pretty new to django..)

I created a django server and I installed dj-static. When I was developping over my computer everything worked great, all the static files was working. Then, when I moved the project over a server and I realized that some static files didn't work... Long story or short, after some time I found that the problem was the way of starting the server:

For example, my project was under /django, and starting it by doing 'python /django/manage runserver 0.0.0.0:80' if my current directory is / some static urls failed. But when doing a cd /django and then starting the server it works like a charm.

kennethreitz commented 8 years ago

This is correct.

I suspect this is actually because of the recommendation (in the README) to use STATIC_ROOT = 'staticfiles, which is a relative path. This should be corrected.