[
  {
    "path": ".travis.yml",
    "content": "language: bash\nservices: docker\n\nenv:\n  - PY_VERSION=3.4\n  - PY_VERSION=2.7\n\ninstall:\n  - git clone https://github.com/docker-library/official-images.git ~/official-images\n\nbefore_script:\n  - env | sort\n  - cd \"$PY_VERSION\"\n  - image=\"django:python$PY_VERSION\"\n\nscript:\n  - docker build -t \"$image\" .\n  - ~/official-images/test/run.sh \"$image\"\n  - docker build -t \"$image-onbuild\" onbuild\n\nafter_script:\n  - docker images\n\n# vim:set et ts=2 sw=2:\n"
  },
  {
    "path": "2.7/Dockerfile",
    "content": "FROM python:2.7-slim\n\nRUN apt-get update && apt-get install -y \\\n\t\tgcc \\\n\t\tgettext \\\n\t\tmysql-client libmysqlclient-dev \\\n\t\tpostgresql-client libpq-dev \\\n\t\tsqlite3 \\\n\t--no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV DJANGO_VERSION 1.10.4\n\nRUN pip install mysqlclient psycopg2 django==\"$DJANGO_VERSION\"\n"
  },
  {
    "path": "2.7/onbuild/Dockerfile",
    "content": "FROM python:2.7\n\nRUN mkdir -p /usr/src/app\nWORKDIR /usr/src/app\n\nONBUILD COPY requirements.txt /usr/src/app/\nONBUILD RUN pip install --no-cache-dir -r requirements.txt\n\nONBUILD COPY . /usr/src/app\n\nRUN apt-get update && apt-get install -y \\\n\t\tgcc \\\n\t\tgettext \\\n\t\tmysql-client libmysqlclient-dev \\\n\t\tpostgresql-client libpq-dev \\\n\t\tsqlite3 \\\n\t--no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nEXPOSE 8000\nCMD [\"python\", \"manage.py\", \"runserver\", \"0.0.0.0:8000\"]\n"
  },
  {
    "path": "3.4/Dockerfile",
    "content": "FROM python:3.4-slim\n\nRUN apt-get update && apt-get install -y \\\n\t\tgcc \\\n\t\tgettext \\\n\t\tmysql-client libmysqlclient-dev \\\n\t\tpostgresql-client libpq-dev \\\n\t\tsqlite3 \\\n\t--no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV DJANGO_VERSION 1.10.4\n\nRUN pip install mysqlclient psycopg2 django==\"$DJANGO_VERSION\"\n"
  },
  {
    "path": "3.4/onbuild/Dockerfile",
    "content": "#\n# NOTE: THIS DOCKERFILE IS GENERATED VIA \"update.sh\"\n#\n# PLEASE DO NOT EDIT IT DIRECTLY.\n#\n\nFROM python:3.4\n\nRUN mkdir -p /usr/src/app\nWORKDIR /usr/src/app\n\nONBUILD COPY requirements.txt /usr/src/app/\nONBUILD RUN pip install --no-cache-dir -r requirements.txt\n\nONBUILD COPY . /usr/src/app\n\nRUN apt-get update && apt-get install -y \\\n\t\tgcc \\\n\t\tgettext \\\n\t\tmysql-client libmysqlclient-dev \\\n\t\tpostgresql-client libpq-dev \\\n\t\tsqlite3 \\\n\t--no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nEXPOSE 8000\nCMD [\"python\", \"manage.py\", \"runserver\", \"0.0.0.0:8000\"]\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) Docker, Inc. and individual contributors.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    1. Redistributions of source code must retain the above copyright notice,\n       this list of conditions and the following disclaimer.\n\n    2. Redistributions in binary form must reproduce the above copyright\n       notice, this list of conditions and the following disclaimer in the\n       documentation and/or other materials provided with the distribution.\n\n    3. Neither the name of Django nor the names of its contributors may be used\n       to endorse or promote products derived from this software without\n       specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "# DEPRECATED\n\nThis image is officially deprecated in favor of [the standard `python` image](https://hub.docker.com/_/python/), and will receive no further updates after 2016-12-31 (Dec 31, 2016). Please adjust your usage accordingly.\n\nFor most usages of this image, it was already not bringing in `django` from this image, but actually from your project's `requirements.txt`, so the only \"value\" being added here was the pre-installing of `mysql-client`, `postgresql-client`, and `sqlite3` for various uses of the `django` framework.\n\nFor example, a `Dockerfile` similar to the following would be a good starting point for a Django project using PostgreSQL:\n\n```dockerfile\nFROM python:3.4\n\nRUN apt-get update \\\n\t&& apt-get install -y --no-install-recommends \\\n\t\tpostgresql-client \\\n\t&& rm -rf /var/lib/apt/lists/*\n\nWORKDIR /usr/src/app\nCOPY requirements.txt ./\nRUN pip install -r requirements.txt\nCOPY . .\n\nEXPOSE 8000\nCMD [\"python\", \"manage.py\", \"runserver\", \"0.0.0.0:8000\"]\n```\n\n# About this Repo\n\nThis is the Git repo of the Docker [official image](https://docs.docker.com/docker-hub/official_repos/) for [django](https://registry.hub.docker.com/_/django/). See [the Docker Hub page](https://registry.hub.docker.com/_/django/) for the full readme on how to use this Docker image and for information regarding contributing and issues.\n\nThe full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), specifically in [docker-library/docs/django](https://github.com/docker-library/docs/tree/master/django).\n\nSee a change merged here that doesn't show up on the Docker Hub yet? Check [the \"library/django\" manifest file in the docker-library/official-images repo](https://github.com/docker-library/official-images/blob/master/library/django), especially [PRs with the \"library/django\" label on that repo](https://github.com/docker-library/official-images/labels/library%2Fdjango). For more information about the official images process, see the [docker-library/official-images readme](https://github.com/docker-library/official-images/blob/master/README.md).\n\n---\n\n-\t[Travis CI:  \n\t![build status badge](https://img.shields.io/travis/docker-library/django/master.svg)](https://travis-ci.org/docker-library/django/branches)\n\n<!-- THIS FILE IS GENERATED BY https://github.com/docker-library/docs/blob/master/generate-repo-stub-readme.sh -->\n"
  },
  {
    "path": "generate-stackbrew-library.sh",
    "content": "#!/bin/bash\nset -eu\n\nlatestPythonMajor='3'\n\nself=\"$(basename \"$BASH_SOURCE\")\"\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\n\npyVersions=( */ )\npyVersions=( \"${pyVersions[@]%/}\" )\n\n# sort version numbers with highest first\nIFS=$'\\n'; pyVersions=( $(echo \"${pyVersions[*]}\" | sort -rV) ); unset IFS\n\n# get the most recent commit which modified any of \"$@\"\nfileCommit() {\n\tgit log -1 --format='format:%H' HEAD -- \"$@\"\n}\n\n# get the most recent commit which modified \"$1/Dockerfile\" or any file COPY'd from \"$1/Dockerfile\"\ndirCommit() {\n\tlocal dir=\"$1\"; shift\n\t(\n\t\tcd \"$dir\"\n\t\tfileCommit \\\n\t\t\tDockerfile \\\n\t\t\t$(git show HEAD:./Dockerfile | awk '\n\t\t\t\ttoupper($1) == \"COPY\" {\n\t\t\t\t\tfor (i = 2; i < NF; i++) {\n\t\t\t\t\t\tprint $i\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t')\n\t)\n}\n\ncat <<-EOH\n# this file is generated via https://github.com/docker-library/django/blob/$(fileCommit \"$self\")/$self\n\nMaintainers: Tianon Gravi <admwiggin@gmail.com> (@tianon),\n             Joseph Ferguson <yosifkit@gmail.com> (@yosifkit)\nGitRepo: https://github.com/docker-library/django.git\nEOH\n\n# prints \"$2$1$3$1...$N\"\njoin() {\n\tlocal sep=\"$1\"; shift\n\tlocal out; printf -v out \"${sep//%/%%}%s\" \"$@\"\n\techo \"${out#$sep}\"\n}\n\nfor pyVersion in \"${pyVersions[@]}\"; do\n\tpyMajor=\"${pyVersion%.*}\"\n\n\tcommit=\"$(dirCommit \"$pyVersion\")\"\n\n\tfullVersion=\"$(git show \"$commit\":\"$pyVersion/Dockerfile\" | awk '$1 == \"ENV\" && $2 == \"DJANGO_VERSION\" { print $3; exit }')\"\n\n\tversionAliases=()\n\twhile [ \"${fullVersion%[.-]*}\" != \"$fullVersion\" ]; do\n\t\tversionAliases+=( $fullVersion )\n\t\tfullVersion=\"${fullVersion%[.-]*}\"\n\tdone\n\tversionAliases+=(\n\t\t$fullVersion\n\t\tlatest\n\t)\n\n\tvariant=\"python$pyMajor\"\n\n\tvariantAliases=( \"${versionAliases[@]/%/-$variant}\" )\n\tvariantAliases=( \"${variantAliases[@]//latest-/}\" )\n\n\tif [ \"$pyMajor\" = \"$latestPythonMajor\" ]; then\n\t\tvariantAliases+=( \"${versionAliases[@]}\" )\n\tfi\n\n\techo\n\tcat <<-EOE\n\t\tTags: $(join ', ' \"${variantAliases[@]}\")\n\t\tGitCommit: $commit\n\t\tDirectory: $pyVersion\n\tEOE\n\n\tfor subVariant in onbuild; do\n\t\t[ -f \"$pyVersion/$subVariant/Dockerfile\" ] || continue\n\n\t\tcommit=\"$(dirCommit \"$pyVersion/$subVariant\")\"\n\n\t\tvariantAliases=( \"$variant-$subVariant\" )\n\t\tif [ \"$pyMajor\" = \"$latestPythonMajor\" ]; then\n\t\t\tvariantAliases+=( \"$subVariant\" )\n\t\tfi\n\n\t\techo\n\t\tcat <<-EOE\n\t\t\tTags: $(join ', ' \"${variantAliases[@]}\")\n\t\t\tGitCommit: $commit\n\t\t\tDirectory: $pyVersion/$subVariant\n\t\tEOE\n\tdone\ndone\n"
  },
  {
    "path": "update.sh",
    "content": "#!/bin/bash\nset -eo pipefail\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\n\nversions=( \"$@\" )\nif [ ${#versions[@]} -eq 0 ]; then\n\tversions=( */ )\nfi\nversions=( \"${versions[@]%/}\" )\n\n#current=\"$(curl -sSL 'https://pypi.python.org/pypi/django/json' | awk -F '\"' '$2 == \"version\" { print $4 }')\" # UGH \"1.8a1\"\ncurrent=\"$(curl -sSL 'https://pypi.python.org/pypi/django/json' | grep '^        \"[0-9].*\\[$' | cut -d '\"' -f2 | grep -vE '[0-9]([abc]|rc)[0-9]' | sort -V | tail -1)\" # TODO remove this heinous thing in favor of something better since it just filters out \"1.8a1\" and \"1.8b1\"\n\ntravisEnv=\nfor version in \"${versions[@]}\"; do\n\t( set -x; sed -ri 's/^(ENV DJANGO_VERSION) .*/\\1 '\"$current\"'/' \"$version/Dockerfile\" )\n\t\n\tpythonOnbuildDockerfile=\"https://raw.githubusercontent.com/docker-library/python/master/$version/onbuild/Dockerfile\"\n\t( set -x; curl -sSL \"$pythonOnbuildDockerfile\" -o \"$version/onbuild/Dockerfile\" )\n\t{\n\t\techo\n\t\t# see http://stackoverflow.com/a/12776899 (line continuations eat our lunch)\n\t\tsed -n ': begin; /\\\\$/ { N; b begin }; /apt-get/ p' \"$version/Dockerfile\"\n\t\techo\n\t\techo 'EXPOSE 8000'\n\t\techo 'CMD [\"python\", \"manage.py\", \"runserver\", \"0.0.0.0:8000\"]'\n\t} >> \"$version/onbuild/Dockerfile\"\n\t\n\tfrom=\"$(awk '$1 == \"FROM\" { print $2 }' \"$version/onbuild/Dockerfile\")\"\n\t( set -x; sed -ri 's/^(FROM) .*/\\1 '\"$from\"'-slim/' \"$version/Dockerfile\" )\n\t\n\ttravisEnv='\\n  - PY_VERSION='\"$version$travisEnv\"\ndone\n\ntravis=\"$(awk -v 'RS=\\n\\n' '$1 == \"env:\" { $0 = \"env:'\"$travisEnv\"'\" } { printf \"%s%s\", $0, RS }' .travis.yml)\"\necho \"$travis\" > .travis.yml\n"
  }
]