Apache with mod_wsgi not serving static files

225 views
Skip to first unread message

Bryan P

unread,
Feb 21, 2014, 7:00:52 PM2/21/14
to django...@googlegroups.com
Hello all,

My Django application is not serving my static files (CSS, JS) and keeps returning a 404 error. I have set the STATIC_ROOT to the location where I collected all my static files with manage.py and set an alias in my VirtualHost. 


Here is my Settings.py

Here is my VirtualHost file

Here is the 404 file


and the url it's trying to retrieve them from i

fixtracker.com/static/BugFixTracker/main.css


This is running in production with debug set to False, so it shouldn't be relying on Django to distribute the files. Any help is much appreciated. 


Alex Mandel

unread,
Feb 21, 2014, 8:48:33 PM2/21/14
to django...@googlegroups.com
On 02/21/2014 04:00 PM, Bryan P wrote:
> Hello all,
>
> My Django application is not serving my static files (CSS, JS) and keeps
> returning a 404 error. I have set the STATIC_ROOT to the location where I
> collected all my static files with manage.py and set an alias in my
> VirtualHost.
>
>
> Here <https://dpaste.de/dP62>is my Settings.py
>
> Here <https://dpaste.de/6bd5>is my VirtualHost file
>
> Here is the 404 file
>
> <https://lh4.googleusercontent.com/-c2TRmfWKF3U/UwfoPptOAFI/AAAAAAAAAFU/x6RLNsPApeM/s1600/404.png>
>
>
> and the url it's trying to retrieve them from i
>
> fixtracker.com/static/BugFixTracker/main.css
>
>
> This is running in production with debug set to False, so it shouldn't be
> relying on Django to distribute the files. Any help is much appreciated.
>

How are you referencing the static in your template? Looks like a
mismatch in path. BugFixTracker isn't in /static according to your vhost
file. So shouldn't the url be:

fixtracker.com/static/main.css

Thanks,
Alex
Reply all
Reply to author
Forward
0 new messages