Hiya! So I’m having this really weird problem. I’m working in django and in the base directory and I ran docker-compose build and docker compose up-d. I’m running on mac so in the docker-compose.yml, so the var/www/static directory doesn’t exist. I changed the volume line for static files to “basedirectory/static:/opt/app/static” (maybe that’s my problem??? I don’t know though because I tried a ton of different directories and nothing took ). After the build completes “successfully”, when I go to localhost:8000 I get a 404 page not found error that says it can’t locate http://worker/. But I can still navigate to localhost:8000/admin. The problem here is that none of my styling loads because all the css files are in the static directory. So then I get these errors
. I think the problem is that the files are not actually going in the base/localhost directory. But honestly I’m just really lost. Any and all help would be greatly appreciated!! Thanks so muchRelated topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Localhost cannot access static files | 0 | 815 | November 16, 2018 | |
Django application (runs in docker container) does not load static files | 1 | 2318 | September 19, 2023 | |
Django Docker Image Works on Local Machine but Shows 'Page Not Found' on AWS EC2 | 3 | 19 | January 19, 2025 | |
Docker compose up --build does not rebuilds the static files | 1 | 1108 | March 28, 2024 | |
Impossible to access localhost:port | 2 | 922 | July 25, 2023 |