Django not serving static files with even after collectstatic

218 views
Skip to first unread message

Dennis Gathagu

unread,
Jul 2, 2017, 8:42:44 PM7/2/17
to Django users

i'm having problems with django static files in production.I know django requires that you collectstatic during deployment, which i did. The real problem comes when i try to access my page on the browser and i get a 403 forbidden error on all static files. I tried changing my permissions and ownership of var/www/html folders to 755 and files to 644 but still no luck. How do i make my static files load?



please advise me on what to do, i have been struggling with this problem for days now.

thanks in advance, Dennis

Dylan Reinhold

unread,
Jul 2, 2017, 8:49:24 PM7/2/17
to django...@googlegroups.com
django does not (should not) serve your static files.
You want your web server to serve up those files, so you dont have the overheard of url routing for files that don't need to run any python code to display.

Dylan

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5ecd31a9-e135-4558-8b8b-1754308cfa35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antonis Christofides

unread,
Jul 3, 2017, 1:46:08 AM7/3/17
to django...@googlegroups.com

Hello,

Take a look at https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/ and if you still have problems show us the related nginx or apache configuration.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com
--
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.
Reply all
Reply to author
Forward
0 new messages