Git Product home page Git Product logo

django-docker's Introduction

evozon/django-docker

A Cookiecutter template for a Django project using Docker. A description of the rationale behind this template is in this blog post.

What is included?

  • Packages for Django project and an app
  • Setup for Celery, uWSGI, debug-toolbar etc
  • Setup for testing using Pytest.
  • Reloader (container that restarts other containers when files change, for development).

Generating the project

Install cookiecutter and run:

cookiecutter gh:evozon/django-docker

You will be asked for these fields:

Template variable Default Description
name
"Nameless"
Project name, used in headings (readme, etc).
repo_name
"python-nameless"
The project's root directory name.
django_project_name
"nameless_project"
Django project name (a package that contains settings and root urls).
compose_project_name
"nmls"
Docker Compose project name (used for the COMPOSE_PROJECT_NAME setting). A short name is suggested to avoid typing a lot when using Docker directly (eg: docker exec nmls_web_1 ...)
django_app_name
"nameless"
Django app name.
short_description
"An example package [...]"
One line description of the project (used in README.rst).

Regenerating the project

If you made some wrong choices during generation you can regenerate it. There are two options:

  • Force Cookiecutter to override the files:

    cookiecutter --overwrite-if-exists --config-file=directory-of-project/.cookiecutterrc gh:evozon/django-docker
  • After installing cookiepatcher run:

    cookiepatcher gh:evozon/django-docker directory-of-project

Using the project

There will be a base image, so for an accurate image building process do this:

docker-compose build --pull base
docker-compose build

To start the project run:

docker-compose up

The project will provide a small shim for running tests, try:

./test.sh --help

Working with the project is the usual docker-compose up and such, nothing special or unexpected.

django-docker's People

Contributors

asfaltboy avatar ionelmc avatar mlderes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

django-docker's Issues

State of the project?

What is the state of this project?

Do you still recommend this setup, or did you switch back to development without docker?

Final instruction has incorrect syntax

The final instruction says

To get started run these:
cd decompete
docker-compose build base --pull
docker-compose build
docker-compose up

It should give the instruction to

  • set up the .env file
  • the syntax of the docker compose build base is wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.