Remove leading whitespace in code blocks from Django docs

This commit is contained in:
Daniel Compton
2019-01-30 15:20:43 +13:00
committed by GitHub
parent 2d179c8734
commit 59eec9832b

View File

@@ -26,13 +26,13 @@ and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extensi
3. Add the following content to the `Dockerfile`.
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
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>=2.0,<3.0
psycopg2>=2.7,<3.0
Django>=2.0,<3.0
psycopg2>=2.7,<3.0
7. Save and close the `requirements.txt` file.
@@ -93,7 +93,7 @@ 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 startproject composeexample .
sudo docker-compose run web django-admin startproject composeexample .
This instructs Compose to run `django-admin startproject composeexample`
in a container, using the `web` service's image and configuration. Because
@@ -107,18 +107,18 @@ the [docker-compose run](/compose/reference/run/) command as follows.
3. After the `docker-compose` command completes, list the contents of your project.
$ ls -l
drwxr-xr-x 2 root root composeexample
-rw-rw-r-- 1 user user docker-compose.yml
-rw-rw-r-- 1 user user Dockerfile
-rwxr-xr-x 1 root root manage.py
-rw-rw-r-- 1 user user requirements.txt
$ ls -l
drwxr-xr-x 2 root root composeexample
-rw-rw-r-- 1 user user docker-compose.yml
-rw-rw-r-- 1 user user Dockerfile
-rwxr-xr-x 1 root root manage.py
-rw-rw-r-- 1 user user requirements.txt
If you are running Docker on Linux, the files `django-admin` created are
owned by root. This happens because the container runs as the root user.
Change the ownership of the new files.
sudo chown -R $USER:$USER .
sudo chown -R $USER:$USER .
If you are running Docker on Mac or Windows, you should already
have ownership of all files, including those generated by