62๐
โ
How is your directory setup? Do you have a folder static
in /home/user/www/oil/oil_database/static_files
? In that case, the directive should look like this (note the trailing slash in /static/
):
location /static/ {
autoindex on;
root /home/user/www/oil/oil_database/static_files;
}
If you want to map the path /home/user/www/oil/oil_database/static_files
to the URL /static/
, you have to either
-
rename the folder
static_files
tostatic
and use this directive:location /static/ { autoindex on; root /home/user/www/oil/oil_database/; }
-
use an alias:
location /static/ { autoindex on; alias /home/user/www/oil/oil_database/static_files/; }
2๐
I have a similar config for my Django sites, but I think you want to use alias
instead of root
for your media. For example:
location /static {
alias /home/user/www/oil/oil_database/static_files;
}
๐คRyan Duffield
- [Django]-Python 3 list(dictionary.keys()) raises error. What am I doing wrong?
- [Django]-Name '_' is not defined
- [Django]-Django: For Loop to Iterate Form Fields
Source:stackexchange.com