I’m just starting with Docker and Django. I try to create example Django project as here: https://docs.docker.com/compose/django
I made Dockerfile, requirements.txt and docker-compose.yml. But when I try to create the Django project using the docker-compose command, I have an error:
docker-compose run web django-admin.py startproject MyProject .
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose\cli\main.py", line 64, in main
File "compose\cli\main.py", line 116, in perform_command
File "compose\cli\main.py", line 712, in run
File "compose\cli\main.py", line 1020, in run_one_off_container
File "compose\cli\main.py", line 1100, 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 0xcd in position 7:
ordinal not in range(128)
Failed to execute script docker-compose
I try to search the same problems, but nothing helps.
Windows 10 Pro (English is not system language, if it’s important).
My Docker:
docker --version
Docker version 17.03.1-ce, build c6d412e
docker-compose --version
docker-compose version 1.11.2, build f963d76f
Dockerfile:
FROM python:2.7
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
requirements.txt:
Django
psycopg2
docker-compose.yml:
version: '2'
services:
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
The first place of django project - C:\Users\Наталья\DoDj , then I had tried from C:\DoDj (in order to escape kyrillic), but had the same error.
Thank your all!