Giter Club home page Giter Club logo

django_docker_template's Introduction

Django Docker Template

This is a template ready to start your new project with django, using docker to create the environment quickly. This app is already configured to run the tests, check the pep8 and coverage using TravisCi. For web server Nginx + Gunicorn.

Content of this template.

  • Django 1.11.4
  • Python 3.6.2
  • nginx 1.13.3
  • gunicorn 19.7.1
  • Mysql 5.7.19
  • PhpMyAdmin 4.7.3

Install Docker and Docker-Compose

If you have not installed you can follow this How To

Cloning this repository

git clone https://github.com/glaubervila/django_docker_template.git <project_name>

Change Git repository

cd <project_name>
rm -rf .git
git init
git add --all
git commit -m "initial commit"

If using github, add the url from the remote repository.

git remote add origin https://github.com/<user>/<repository>.git
git push -u origin master

Up Containers

Create an .env file with the variables, and edit the file to change the project name and default ports values if needed.

# cat env_template >> .env

Build and run app with Compose

# sudo docker-compose build
# sudo docker-compose up

Tip: you want to run your services in the background, you can pass the -d flag (for “detached” mode) to docker-compose up and use docker-compose ps to see what is currently running:

# sudo docker-compose up -d

Test in brownser

Access localhost:port (port is declared in .env file) by default in 80.

Create superuser in Django

sudo docker-compose run --rm web python manage.py createsuperuser

Enable Travis and Coveralls

django_docker_template's People

Contributors

glaubervila avatar

Stargazers

Alexander Serditov 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.