The rest of the site is working fine but the admin page isbroken since it can’t find the CSS. Works perfect in local but breaks after deploy
here is the static file config in settings.py
# Static files (CSS, JavaScript, Images)
#Application Level
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR, "files")
#Global
STATICFILES_DIRS = [
BASE_DIR / 'assets'
]
all my static files is in ‘assets’ folder in root.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hey!
Did you run
python manage.py collectstatic
after you deployed your app?One thing that you could try here would be to also set the
STATICFILES_DIRS
env in your settings file:If none of those help, what you could try is to set the
DEBUG = True
in your settings file to see if you would get some extra information. And also check your web console to see which folder are the files being loaded from exactly.Let me know how it goes!
Best,
Bobby