I know this has been discussed before but nothing worked for me,
I deployed my first Django app yesterday with Nginx and gunicorn but sadly it is not serving the static files.
I have gone through every answer to the same problem but I couldn't find the way out.
Probably I am doing something wrong.
I am on django 2.1
all my static files are under project/static
Settings.py
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
I haven't mentioned any static dir because all the files are in static only.
urls.py ( is it necessary in deployment? )
static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
nginx.confg
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
alias /root/project/projectname/static;
}
my project is in root/project I don't know if it is a good practice or not I am quite a novice in this.