Why some static files work, but others don't?

170 views
Skip to first unread message

Jason S

unread,
May 15, 2014, 7:53:34 AM5/15/14
to django...@googlegroups.com
Hi,
I've just created a really basic django site, its got the tutorial polls and thats about it.
I've added in the metro UI and added it to the static files directory under the appropriate app.
I've also used the collectstatic command and it picks up the files.

But both with Apache and using runserver i'm only able to find CSS files, the js files are 404.
[15/May/2014 11:44:35] "GET / HTTP/1.1" 200 2941
[15/May/2014 11:44:35] "GET /static/MetroUI/css/metro-bootstrap.css HTTP/1.1" 304 0
[15/May/2014 11:44:35] "GET /static/MetroUI/js/metro/metro.min.js HTTP/1.1" 404 1688
[15/May/2014 11:44:35] "GET /static/MetroUI/js/jquery/jquery.min.js HTTP/1.1" 404 1694
[15/May/2014 11:44:35] "GET /static/MetroUI/js/jquery/jquery.widget.min.js HTTP/1.1" 404 1715

The file permissions are the same and the files are definitely in the right path.
Any idea why they aren't found, but the CSS files are?

Thanks,
J

Venkatraman S

unread,
May 16, 2014, 4:23:17 AM5/16/14
to django...@googlegroups.com
Naive Q: did you check if the js files exist there? 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/65591ec5-dbef-4c2c-8f97-125a93174b87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason S

unread,
May 16, 2014, 8:46:19 PM5/16/14
to django...@googlegroups.com
Not naive, its good to troubleshoot from the beginning.
I've double checked that the files are in the paths, I had a play with the settings, even temporarily setting them to 777 to be sure its not a permission fault.

Then i realised that I was in the project/static directory, i ensured the files were in an app's static directory and ran a python manage collectstatic and that did the trick.
Thanks for the help!
Reply all
Reply to author
Forward
0 new messages