Reputation: 181
I know that there is few topic with this problem, but I still cannot resolve it. I have this structure
/home
/server
/server_1
/static
Static was generated by collectstatic and I have there all my staticfiles (include admin/css)
Alias for static files in apach conifg look like:
Alias /static/ /home/server/server_1/static/
<Directory /home/server/server_1/static/>
Require all granted
</Directory>
When I'm running django admin page I can see login panel but without css but If i I click 'show page source' I can see
<link rel="stylesheet" type="text/css" href="/static/admin/css/base.css" />
And I can click, and I can see whole css code (no 404 error) So, server can see this file? But it can use it or what?
When I'm trying open:
http://www.my.server.com/static/
I'm getting
Forbidden
You don't have permission to access /static/ on this server.
I have STATIC_ROOT, and STATIC_URL, I can correctly run collectstatif, but server has some problem with render it.
EDIT
I've just installed django-rest-framework and this server and same situation with css. Css files are in serveradres.com/static/, I can access to it by redirect serveradres.com/static/rest_framework/css/bootstrap.min.css
But site still render page without this css.
UPDATE
Google chrome inspector saying:
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
Upvotes: 0
Views: 236
Reputation: 181
I solved this. I know - this is strange, but it was caused by an adblock in google chrom. When I turn it off, it works.
Upvotes: 0
Reputation: 58523
The user that Apache runs as can't see inside home directories with the permissions that are usually set on home directories by a Linux system. It is recommended you move your application code outside of your home directory to somewhere the Apache user can see.
Upvotes: 1