Skip to content

malcata/docker-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-django

A dockerfile to run django

Why

The official docker image for django is deprecated since 31 Dec 2016. Even that did not seem development friendly, since it generated images with a copied version of the project instead of a mounted project folder.

How to install

  1. Install docker ;-)
  2. Clone repository:
https://github.com/malcata/docker-django.git
  1. Configure required environment variables, eventually on a bash_profile file:
$ export SOURCE_DIR="<project source folder>"

Usage

  1. Generate the docker image
$ make build
  1. Add to the environment the following variables (.bash_profile or .bashrc):
export SOURCE_DIR?=~/source/project
# ONLY NEEDED FOR NEW PROJECTS
export PROJECT_NAME?=newproject
export DJANGO_SECRET_KEY?=pleasereplacethis
  1. (optional) First time to create the django project
$ make startproject
  1. Run the container
$ make run
  1. Use browser to access django http://localhost:8000

Check the Makefile for further details.

Contributing

Please follow the Github flow process (branch, commits and pull request)...

License

The code in this repository, unless otherwise noted, is MIT licensed. See the 'LICENSE' file in this repository.

About

A dockerfile to run django

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published