diff --git a/compose/django.md b/compose/django.md index 334cce96f9..a65bd5d8b4 100644 --- a/compose/django.md +++ b/compose/django.md @@ -30,9 +30,9 @@ and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extensi ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code - ADD requirements.txt /code/ + COPY requirements.txt /code/ RUN pip install -r requirements.txt - ADD . /code/ + COPY . /code/ This `Dockerfile` starts with a [Python 3 parent image](https://hub.docker.com/r/library/python/tags/3/). The parent image is modified by adding a new `code` directory. The parent image is further modified @@ -46,8 +46,8 @@ and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extensi 6. Add the required software in the file. - Django>=1.8,<2.0 - psycopg2 + Django>=2.0,<3.0 + psycopg2>=2.7,<3.0 7. Save and close the `requirements.txt` file. @@ -71,7 +71,7 @@ and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extensi image: postgres web: build: . - command: python3 manage.py runserver 0.0.0.0:8000 + command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: @@ -93,15 +93,15 @@ In this step, you create a Django starter project by building the image from the 2. Create the Django project by running the [docker-compose run](/compose/reference/run/) command as follows. - sudo docker-compose run web django-admin.py startproject composeexample . + sudo docker-compose run web django-admin startproject composeexample . - This instructs Compose to run `django-admin.py startproject composeexample` + This instructs Compose to run `django-admin startproject composeexample` in a container, using the `web` service's image and configuration. Because the `web` image doesn't exist yet, Compose builds it from the current directory, as specified by the `build: .` line in `docker-compose.yml`. Once the `web` service image is built, Compose runs it and executes the - `django-admin.py startproject` command in the container. This command + `django-admin startproject` command in the container. This command instructs Django to create a set of files and directories representing a Django project. @@ -202,7 +202,7 @@ In this section, you set up the database connection for Django. 5. List running containers. - In another terminal window, list the running Docker processes with the `docker ps` command. + In another terminal window, list the running Docker processes with the `docker container ls` command. ```none $ docker ps diff --git a/compose/images/django-it-worked.png b/compose/images/django-it-worked.png index 0bbdf1a921..a96a3b0aec 100644 Binary files a/compose/images/django-it-worked.png and b/compose/images/django-it-worked.png differ