[Answered ]-Cannot find Django admin static file (404 not found)

1👍

Assuming your BASE_DIR is the same as /usr/share/nginx/html, and the BASE_DIR/myproject/static exists and has content, try

location /static/ {
    root /myproject/;
}

(Using root rather than alias as the end directories are the same, as per nginx docs)

I am assuming your earlier root definition will prefix the location – if not you might have to use root /usr/share/nginx/html/myproject/ explicitly instead

Leave a comment