Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manage.py dbshell not working with Docker setup #3

Open
bittner opened this issue Feb 15, 2017 · 5 comments
Open

manage.py dbshell not working with Docker setup #3

bittner opened this issue Feb 15, 2017 · 5 comments

Comments

@bittner
Copy link
Member

bittner commented Feb 15, 2017

Current Behavior

As a developer
when I use Docker Compose for development
and I try to run python manage.py dbshell
then execution is aborted,
because the database client is missing on the application image.

$ docker-compose run application python manage.py dbshell
CommandError: You appear not to have the 'psql' program installed or on your path.

Expected Behavior

  • Whether we use a Postgres database or Mariadb/MySQL with Django in our Docker setup, python manage.py dbshell should always work in development (as without Docker).
  • For production, the database client is not needed, and should ideally not be integrated (to reduce image size, operational and security risks).
@akikochuchu
Copy link

Thank you

@vkgyl2432
Copy link

@bittner any update/fix for this?

@bittner
Copy link
Member Author

bittner commented Jun 3, 2018

Not yet, but this should be much cleaner to fix today. With pipenv we can now cleanly put development dependencies into a project.

We'd have to replace the requirements.txt file by a Pipfile. Would you want to take a look at the Pipfile format and try to place a pull request?

@ashrafkvt
Copy link

@bittner any update?

@bittner
Copy link
Member Author

bittner commented Mar 27, 2023

This is easier to do than ever now.

  1. The Dockerfile is flexible enough to pick any requirements.txt file you need.
  2. You can simply add the needed development dependencies to requirements-dev.txt in your Django or Flask project.
  3. The docker-compose.yml file will pick up those new requirements when you develop locally.

Hence, if you want to contribute and open a PR to add the required dependency to requirements-dev.txt please go ahead! (Note that we need to make it conditional based on the chosen database.)

Thanks for pinging! 👍 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants