I have searched around and apologize if this is a basic question. I am trying to get my django app to serve static files. If the STATIC_URL is set to the absolute path (ie http://localhost/static) then the files work however if STATIC_URL is relative like /static/ it doesn’t pull in any static files.
I would like it to be able to use /static/ for when I move the application to a production server and have a reverse proxy serving the static files.
django requires
STATIC_DIRto be absolute path.set a variable like
PROJECT_DIRtoos.path.dirname(os.path.realpath(__file__)).then set
STATIC_DIRtoos.path.join(PROJECT_DIR, 'static')