Django 如何在docker上从ascii postgresql数据库切换到utf8?
我在docker bash中遇到了一个问题,我正在尝试使用Django 如何在docker上从ascii postgresql数据库切换到utf8?,django,postgresql,docker,utf-8,Django,Postgresql,Docker,Utf 8,我在docker bash中遇到了一个问题,我正在尝试使用docker compose exec web python manage.py createsuperuser在django上创建一个超级用户,但我在下面遇到了这个错误 Traceback (most recent call last): File "docker-compose", line 3, in <module> File "compose\cli\main.py", line 68, in main
docker compose exec web python manage.py createsuperuser
在django上创建一个超级用户,但我在下面遇到了这个错误
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose\cli\main.py", line 68, in main
File "compose\cli\main.py", line 118, in perform_command
File "compose\cli\main.py", line 431, in exec_command
File "compose\cli\main.py", line 1236, in call_docker
File "distutils\spawn.py", line 220, in find_executable
File "ntpath.py", line 85, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 8: ordinal not in range(128)
Failed to execute script docker-compose
Docker compose.yml
version: '2'
services:
nginx:
image: nginx:latest
container_name: NGINX
ports:
- "8000:8000"
volumes:
- ./src:/src
- ./config/nginx:/etc/nginx/conf.d
- /static:/static
- /media:/media
depends_on:
- web
web:
restart: always
build: .
container_name: DJANGO
command: bash -c "python manage.py collectstatic --noinput && python manage.py makemigrations && python manage.py migrate && gunicorn oqtor.wsgi -b 0.0.0.0:8000"
depends_on:
- db
volumes:
- ./src:/src
- /static:/static
- /media:/media
expose:
- "8000"
db:
image: postgres:latest
container_name: PSQL
在docker-compose.yml中有一个波浪形字符(“é”)
编辑。可能在涉及的路径中有重音符号,并且可能在主机中遇到一些python错误。您可以尝试在主机中更新python(docker compose是用python制作的)。可能在涉及的路径中有重音符号?docker compose的位置。是的,我找到了一条带有口音的路径…谢谢
version: '2'
services:
nginx:
image: nginx:latest
container_name: NGINX
ports:
- "8000:8000"
volumes:
- ./src:/src
- ./config/nginx:/etc/nginx/conf.d
- /static:/static
- /media:/media
depends_on:
- web
web:
restart: always
build: .
container_name: DJANGO
command: bash -c "python manage.py collectstatic --noinput && python manage.py makemigrations && python manage.py migrate && gunicorn oqtor.wsgi -b 0.0.0.0:8000"
depends_on:
- db
volumes:
- ./src:/src
- /static:/static
- /media:/media
expose:
- "8000"
db:
image: postgres:latest
container_name: PSQL