For those who are getting error: django.db.utils.operationalerror: could not translate host name "db" to address: temporary failure in name resolution You should consider adding the addiotional configs to your docker-compose file: db: image: postgres ports: - 5432:5432 volumes: - pgdata:/var/lib/postgresql/data - pgconf:/etc/postgresql - pglog:/var/log/postgresql environment: - POSTGRES_DB=postgres - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres container_name: postgres_db volumes: pgdata: driver: local pgconf: driver: local pglog: driver: local
Excellent, But I am getting some error which can't be resolved by me. Can you help me on that.... django.db.utils.OperationalError: could not translate host name "db" to address: Temporary failure in name resolution
Hi Kaushal, difficult to fully diagnose without seeing the code. Presume you have named the db service db in the docker file. Best way for me to help you and anyone else if to start a stack overflow post and put the link in here. stackoverflow.com/questions/41573313/docker-compose-with-django-could-not-translate-host-name-db-to-address-name-o
Hi , anyone with this error ? : raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) django-container2 | django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'. (UPDATE Fix) I had to delete my previous app image and create it again so it could install the psycopg2-binary package.
You dont need to. However, once things start to scale then you find that might be the most effective way to work. Also it is easier to manage services this way.
Thanks Ayesh I have a running order from other members requests. 6. Deploy to Heroku 7. Django + React 8. Deploy to Digital Ocean 9. PostGres PGAdmin setup
What do you mean? I'm learning Docker too but when you want to do a migration in your local machine you gotta do it through your OS command prompt. In this case as you are running the django app in a Linux OS container you need to do it via Bash?
Thanks so mch Mr. Zanda
For those who are getting error: django.db.utils.operationalerror: could not translate host name "db" to address: temporary failure in name resolution
You should consider adding the addiotional configs to your docker-compose file:
db:
image: postgres
ports:
- 5432:5432
volumes:
- pgdata:/var/lib/postgresql/data
- pgconf:/etc/postgresql
- pglog:/var/log/postgresql
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
container_name: postgres_db
volumes:
pgdata:
driver: local
pgconf:
driver: local
pglog:
driver: local
Thank you 🙏
Thank you!
Thanks! I'm not sure why that fixed it though
Awesome tutorial, thank you for all the good information
Zander, can you make a video with Django API + React Frontend Docker Package/Deployment? That would be a great addition to this series!!
Hey - I keep telling people I will and not get around to it!
@@veryacademy I want this too!
Again Love from India ❤️
👍
Thank you very much for this tutorial. You are a very good teacher.
Where does the /var/lib/PostgreSQL/data come from?
What about production? Do you have the real data stored on the machine, where the app is running? In this case in ./data/db?
Thanks a lot for very good tutorial
Helpful, thanks!
Awesome as always 👍😀
Thank you! Cheers!
Excellent,
But I am getting some error which can't be resolved by me.
Can you help me on that....
django.db.utils.OperationalError: could not translate host name "db" to address: Temporary failure in name resolution
Hi Kaushal, difficult to fully diagnose without seeing the code. Presume you have named the db service db in the docker file. Best way for me to help you and anyone else if to start a stack overflow post and put the link in here.
stackoverflow.com/questions/41573313/docker-compose-with-django-could-not-translate-host-name-db-to-address-name-o
amazing thank you
thank you very much
Thank you 🙏
Please teach us how to do *Docker + Django + React/Vue* much love!!
No problem - will do a docker React then docker django react
@@veryacademy i love you!
Always releasing new interesting videos
Glad you think so!
Getting an error as below:
docker endpoint for "default" not found
Please help.
Hi , anyone with this error ? : raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django-container2 | django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'.
(UPDATE Fix) I had to delete my previous app image and create it again so it could install the psycopg2-binary package.
Excellent. Gained a sub
Welcome aboard! Thank you!
Why do you need to create another container for every service?
You dont need to. However, once things start to scale then you find that might be the most effective way to work. Also it is easier to manage services this way.
@@veryacademy Ok got it good tutorial tough
Thank you.
Those who face pg_config executable not found. add below line inside Dockerfile
RUN pip install --upgrade pip
RUN pip3 install -r requirements.txt
Could you make an update request on GitHub I will merge it?
awesome....Thanks for the trouble
No worries! 👍
It is supposed to run both ways with or without docker.
Right?
Point is here we can put Postgres and MySQL in a container so that you don't have to installed them on your computer.
@@veryacademySo it is not supposed to run without docker .Right?
@@veryacademy So it will give error without docker ?Right?
@@veryacademy How to check if the data is added into a table or not
A docker container requires docker installed
Is there a way to connect these hosted DBs on Docker with MySql Workbench or PG Admin installed on Host PC for monitoring purposes?
Thanks Ayesh
I have a running order from other members requests.
6. Deploy to Heroku
7. Django + React
8. Deploy to Digital Ocean
9. PostGres PGAdmin setup
Is there a way to do the database migration that does not involve doing it manually via bash every time?
What do you mean? I'm learning Docker too but when you want to do a migration in your local machine you gotta do it through your OS command prompt. In this case as you are running the django app in a Linux OS container you need to do it via Bash?
i dont have 'data' directoty((