[Fixed]-Django admin not serving static files on Apache

0👍

✅

When you serve static files using apache, static folder is supposed to be in your /var/www/html directory. I had gone through same scenario as yours. collectstatic didnt work for me. What I did was, copied static contents of admin app to /var/www/html/static/admin. This admin directory contains four other directories css, fonts, img and js. In my case apache setup was the default so /var/www/html was my public directory. Following can be used for reference.

server
    |
    -var
       | 
        -www
            |
             -html
                  |
                  - static
                         |
                         -admin
                               |-css
                               |-fonts
                               |-img
                               |-js

You can try aforementioned approach. It would be helpful if you let know issue is resolved.

1👍

Check the following things

1)Did you add STATIC_ROOT in settings file?

2)After activating the virtual environment(if any), did you run

python manage.py collectstatic

Leave a comment