如何用docker-compose删除`django_admin_log`?

我正在为我的Django应用程序使用docker-compose.yml文件,我正在尝试执行docker-compose run web python manage.py dbshell并像这里一样删除表django_admin_log

但是这回来了
CommandError: You appear not to have the 'psql' program installed or on your path.

我该如何做python manage.py dbshell或删除表django_admin_log

这是我的docker-compose.yml

 storage: image: busybox volumes: - /var/lib/postgresql/data - /data command: true db: image: postgres environment: - POSTGRESQL_DB=postgres - POSTGRESQL_USER=postgres - POSTGRESQL_PASSWORD=password volumes_from: - storage web: build: . environment: - DATABASE_HOST=postgres command: ./run_web.sh ports: - "80:80" links: - db 

谢谢

假设您正在使用基于Debian或Ubuntu的映像,请在Dockerfile中添加以下行:

 RUN apt-get update && apt-get -y install postgresql 

这将为您安装psql命令,并允许您使用dbshel​​l。