#Help on using django with docker
1 messages · Page 1 of 1 (latest)
You can pass an env var using arg but you can also just define * in settings for local dev
How can I use the env in setting.py as I am unable to access the setting.py in dockerfile. To use * I have to do it manually right ? or is there any workaround ?
to use what? what do you mean by manually? what do you mean by accessing a file from dockerfile?
you may want to share what do you have and what have tried, the context is not rich enough that we can understand and try to help
did you solve all?
not yet
so how can i help you?
If you found something related to this please share.
You have not shared enough info for us to help you
You can access anything inside a docker container by using the CLI. The command to enter a docker container and interactively work in it like it’s an OS is docker exec -it <name-of-container> (then your command, like ‘bash’)
Docker exec -it mydjango_container bash
Something like that, iron out the details with ChatGpT.
Then you can be inside your docker container and work like any Linux box:
ls
cat settings.py
Nano settings.py (to make changes)
Last time I checked that’s how I interacted inside my docker containers. Please double check with 🤖 chatbot
So you are writing your first django app which is still in development?
Basically you volume mount your project into the container, so you can just easily alter the settings.py from within your ide.
Can we stop suggesting that people ask AI for answers, when the one and only correct thing to suggest is official documentation?
https://docs.docker.com/reference/cli/docker/container/exec/