Closed pramishp closed 3 years ago
Hi,
After setting that value did you run a docker-compose build
before upping it?
Ah I know what happened.
If you're going to set DEBUG=false
you also need to set NODE_ENV=production
. If you don't set node to production then Django's collectstatic won't find any assets since they won't get generated by Webpack and when you visit the home page you'll get a 500 which throws ValueError: Missing staticfiles manifest entry for 'css/app.css'
because our template references that file.
You can find the real cause of the 500 with DEBUG=false
if you goto the settings and put DEBUG_PROPAGATE_EXCEPTIONS = True
.
To properly emulate production on a real server you'll want to run:
./run clean
.env
file comment out export DOCKER_WEB_VOLUME=.:/app
docker-compose.override.yml
to docker-compose.override.yml.bak
(disable the Webpack watcher)docker-compose down -v --remove-orphans
docker-compose build
docker-compose up
Now it should work.
It's really important to run the build command because that's going to ensure collectstatic gets run.
I'm going to close this one since the above is very likely the case. Feel free to re-open it if it's not.
thank you for this excellent docker django example. I am getting 500 on setting debug=false in env file