Я только что развернул свой сайт django на сервере Ubunto. Но он не загружает статический файл.
settings.py:
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),]
STATIC_ROOT = 'staticfiles'
nginx / sites-available конфигурация:
server {
server_name 138.197.172.33;
access_log off;
location /staticfiles/ {
root staticfiles;
}
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
}
Ошибка:
...
[14/May/2018 05:28:28] "GET /static/vendors/underscore/underscore.js
HTTP/1.1" 404 113
[2018-05-14 05:28:29,252] base: WARNING - Not Found:
/static/vendors/bootstrap-notify-simple-wrapper/bootstrap-notify-
simple-wrapper.min.js
[14/May/2018 05:28:29] "GET /static/vendors/bootstrap-notify-simple-
wrapper/bootstrap-notify-simple-wrapper.min.js HTTP/1.1" 404 159
[2018-05-14 05:28:29,690] base: WARNING - Not Found:
/static/js/custom.js
[14/May/2018 05:28:29] "GET /static/js/custom.js HTTP/1.1" 404 93
[2018-05-14 05:28:30,236] base: WARNING - Not Found:
/static/js/converter.js
[14/May/2018 05:28:30] "GET /static/js/converter.js HTTP/1.1" 404 96
...
Папка
staticfiles содержит:
admin ajaximage css datatable dm2bn fonts images js static
tinymce vendors