Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

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

Open
rsm-gh opened this issue Jul 21, 2015 · 1 comment
Open

Comments

@rsm-gh
Copy link

rsm-gh commented Jul 21, 2015

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.

@kennethreitz
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants