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:
it seems that to make dj-static work correctly, the current working directory must be in the mange folder.
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.
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.
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:
mange
folder.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 acd /django
and then starting the server it works like a charm.