Coder Social home page Coder Social logo

daniel-tomaszuk / docker-django-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukin0110/docker-django-boilerplate

0.0 1.0 0.0 35 KB

Minimal boilerplate setup for a Django project with Docker.

License: Apache License 2.0

Dockerfile 11.23% Python 68.92% Shell 19.84%

docker-django-boilerplate's Introduction

Docker Django Boilerplate

Minimal setup for a Django project with Docker, following the 12factor app principles. This repo contains skeleton code to get up and running with Docker & Django quickly. The image uses uWSGI to host the Django project. It's up to you to put Nginx or Apache in front in production.

This image is not intended as being a base image for a Django project. It's a boilerplate, you can copy/paste this and use it as a base to start a project. The image contains the hello Django project. Replace the word hello with the name of your project.

Usage

Download the repository:

$ git clone https://github.com/lukin0110/docker-django-boilerplate.git

Init project:

$ cd docker-django-boilerplate
$ docker-compose build

Setup database:

$ docker-compose up -d postgres
$ docker-compose run app setup_db

Launch:

$ docker-compose up app

Launch Nginx (optional):

$ docker-compose up web

Now your django app is available on http://localhost, but it's optional for development

Container commands

The image has

Run a command:

$ docker-compose run app <command>

Available commands:

Command Description
dev Start a normal Django development server
bash Start a bash shell
manage Start manage.py
setup_db Setup the initial database. Configure $POSTGRES_DB_NAME in docker-compose.yml
lint Run pylint
python Run a python command
shell Start a Django Python shell
uwsgi Run uwsgi server
help Show this message

Create a Django app

$ docker-compose run app manage startapp myapp

Create a super user

$ docker-compose run app manage createsuperuser

Awesome resources

Useful awesome list to learn more about all the different components used in this repository.

Useful links

docker-django-boilerplate's People

Contributors

lukin0110 avatar

Watchers

 avatar

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.