Sign inSign up

rvernica/django

By rvernica

•Updated about 9 years ago

Image for Django

Image
0

2.7K

rvernica/django repository overview

⁠Django

⁠Tags

TagDjangoPythonDownload SizeImage Size
django:python3⁠1.10.33.5116.8MB
django:python3-onbuild⁠1.10.3 onbuild3.584.6MB
django:python3-lts⁠1.8.16 LTS3.5114.4MB
django:python2⁠1.10.32.7104.5MB
django:python2-onbuild⁠1.10.3 onbuild2.772.5MB
django:python2-lts⁠1.8.16 LTS2.7102.1MB

⁠What is Django?

Django is a free and open source web application framework, written in Python, which follows the model-view-controller architectural pattern. Django's primary goal is to ease the creation of complex, database-driven websites with an emphasis on reusability and "pluggability" of components.

Django logo

⁠How to use this image

⁠Create a Dockerfile in your Django app project

FROM rvernica/django:onbuild

Put this file in the root of your app, next to the requirements.txt.

This image includes multiple ONBUILD triggers which should cover most applications. The build will COPY . /usr/src/app, RUN pip install, EXPOSE 8000, and set the default command to python manage.py runserver.

You can then build and run the Docker image:

$ docker build --tag my-django-app .
$ docker run --name some-django-app --detach my-django-app

You can test it by visiting http://container-ip:8000 in a browser or, if you need access outside the host, on http://localhost:8000 with the following command:

$ docker run --name some-django-app --publish 8000:8000 --detach my-django-app

⁠Without a Dockerfile

Of course, if you don't want to take advantage of magical and convenient ONBUILD triggers, you can always just use docker run directly to avoid having to add a Dockerfile to your project.

$ docker run --name some-django-app --volume "$PWD":/usr/src/app --workdir /usr/src/app --publish 8000:8000 --detach rvernica/django bash -c "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:8000"

⁠Bootstrap a new Django Application

If you want to generate the scaffolding for a new Django project, you can do the following:

$ docker run --interactive --tty --rm --user "$(id -u):$(id -g)" --volume "$PWD":/usr/src/app --workdir /usr/src/app rvernica/django django-admin.py startproject mysite

This will create a sub-directory named mysite inside your current directory.

⁠About this image

This Docker library is a fork of the Docker Official Image packaging for Django⁠. The official image is currently deprecated⁠ and will receive no further updates⁠ starting 2017.

Tag summary

Content type

Image

Digest

Size

41.2 MB

Last updated

about 9 years ago

docker pull rvernica/django