I am using Django as my Web-Framework. As a database I use PostgresSQL. To start my Postgres Database and the Webserver I use Docker.
When I start the server and db with docker-compose up, everything works fine. The database loads properly into Django and I dont get any errors.
But when I run for example python3 manange.py makemigrations django throws an error:
could not translate host name "db" to address: Name or service not known
Where "db" is the name of my postgres database. This is even then when server and database are running on a different window. What I find very weird is that the Database is found when I start with docker.
How do I access commands like python3 manage.py [...]?
So for example I need to create a superuser and dont know where to create that because if I use the normal python3 manage.py createsuperuser I get the same error as above.
The console window from starting docker I also cannot use because there the Django Server runs and just displays the incoming http posts and requests.