Getting started with PostgreSQL and Python

Start by running your Docker Desktop application. Then via the command line run the following command to pull the latest postgres image and start an instance.

docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword --name postgres_docker postgres

We will now have a Docker image of postgres running with a default database named postgres. To create a new database or to log directly into the instance, we can use the below command.

docker exec -it postgres_docker psql -U postgres

That's with Docker and PostgreSQL setup. Let's now dive into Python project.

Write a comment ...

Vishnu Dileesh

Show your support

Hey there! 👋 I love sharing my coding journey, insights, and tutorials to help fellow developers grow. If you've found my content valuable, consider supporting my work! Your contributions help me keep creating quality content, explore new topics, and share more useful resources with the community. Thanks for your support! ❤️

Write a comment ...