Forums

Django Admin Css not working

I deployed my django app and everything working fine, only admin css is not wotking , here is the link for images of my pythonanywhere settings and admin panel https://imgur.com/a/B9mbPhS

Settings.py

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

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

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'main/media')

Have you run the collectstatic management command and set up the static file routing on the "Web" page? See this help page for details.

yes I did the same as mentioned in help page and also run collectstatic, issue is only with admin panel css, app static files are working as intended.

If you use your browser's developer console to watch the network traffic when you load one of the admin pages, do you see 404 errors on the stylesheets?

No error reported in console

Do you look at the network tab there in the dev tools?

yes there 404 error in network tab

This forum thread is over a year old, so I'm guessing you're not the original poster above (showing up as deleted-user-8676816). What is the configuration that you have for your static files?