1
votes

when I access to my admin dashboard in Django, it doesn't load css and img files, so doesn't work well. All the files are in 'project/static/admin', and in my settins.py I have this:

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static")

When I execute collectstatic, appears: 0 static files copied to '/opt/myenv/myenv/static', 318 unmodified.

I'm using Nginx + Gunicorn, also I'm using https with Cloudflare. Can anyone help me? Thanks.

1
did you set location /static { root /path/static/; } in your nginx file - Lemayzeur
I just posted an answer about, @Alasdair is right, you should put STATICFILES_DIRS - Lemayzeur

1 Answers

1
votes

You run collectstatic with STATIC_ROOT set up If you do not have this in your settings.py , add it

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]