• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    Python
  • License
    ISC License
  • Created almost 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example using Docker, Django, multiple Postgres databases, NginX, Gunicorn, pipenv, GitLab CI and tox.

Example using Docker, Django, multiple Postgres databases, NginX, Gunicorn, pipenv, GitLab CI and tox

This is a Docker setup for a web application based on Django.

  • The Django application is served by Gunicorn (WSGI application).
  • We use NginX as reverse proxy and static files server. Static and media files are persistently stored in volumes.
  • Multiple Postgres databases can be used. Data are persistently stored in volumes.
  • Python dependencies are managed through pipenv, with Pipfile and Pipfile.lock.
  • Support for multiple environment settings (variable DJANGO_SETTINGS_MODULE is passed to the djangoapp service).
  • Tests are run using tox, pytest, and other tools such as safety, bandit, isort and prospector.
  • Continuous Integration is configured for GitLab with .gitlab-ci.yml. CI follows a Build-Test-Release flow. WARNING: this part is not fully functional yet.

Also a Makefile is available for convenience. You might need to use sudo make instead of just make because docker and docker-compose commands often needs admin privilege.

Requirements

You need to install Docker and Docker-Compose.

Build

docker-compose build or make build.

Migrate databases

docker-compose run --rm djangoapp hello/manage.py migrate or make migrate.

Collect static files

docker-compose run --rm djangoapp hello/manage.py collectstatic --no-input' or make collectstatic.

Run

docker-compose up or make run.

Tests

  • make checksafety
  • make checkstyle
  • make test
  • make coverage

Related blog post

Docker Compose with NginX, Django, Gunicorn and multiple Postgres databases

License

Software licensed under the ISC license.

More Repositories

1

aria2p

Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.
Python
471
star
2

git-changelog

Automatic Changelog generator using Jinja2 templates.
Python
134
star
3

shell-history

Visualize your shell usage with Highcharts!
Python
110
star
4

markdown-exec

Utilities to execute code blocks in Markdown files.
Python
95
star
5

duty

A simple task runner.
Python
89
star
6

django-zxcvbn-password

Back-end and Front-end password validation with ZXCVBN
Python
86
star
7

copier-pdm

Copier template for Python projects managed by PDM.
Jinja
83
star
8

django-suit-dashboard

Create a dashboard within Django admin interface.
Python
83
star
9

copier-poetry

Copier template for Python projects managed by Poetry.
Jinja
79
star
10

awesome-repository

A curated list of services, tools and standards about (open source) repository management.
60
star
11

website

My personal website.
Python
46
star
12

cookiecutter-awesome

Cookiecutter to create an awesome list.
Python
41
star
13

shellman

Write documentation in comments and render it with templates.
Python
37
star
14

docker-nginx-auth-request-django-shiny-example

Example using Docker, Nginx with auth-request module, and Django acting as a authentication wrapper around a Shiny app.
Python
22
star
15

dependenpy

Show the inter-dependencies between modules of Python packages.
Python
22
star
16

mkdocs-coverage

MkDocs plugin to integrate your coverage HTML report into your site.
Python
21
star
17

mkdocs-spellcheck

A spell checker plugin for MkDocs.
Python
16
star
18

copier-uv

Copier template for Python projects managed by uv.
Jinja
16
star
19

django-appsettings

Application settings helper for Django apps.
Python
15
star
20

django-meerkat

Security audit tool for Django sites
JavaScript
14
star
21

archan

Analysis of your architecture strength based on DSM data.
Python
12
star
22

mkdocs-gallery

A gallery of MkDocs themes, showing off a few plugins and extensions.
Python
12
star
23

moving-stars

⭐ Copy GitHub stars to GitLab 🌠
Python
10
star
24

pawabot

A Telegram Bot for many things: aria2 management, torrent sites crawling, media organization with filebot and Plex.
Python
9
star
25

django-archan

A Django app that displays dependency matrices and other project architecture information
Python
9
star
26

cookie-poetry

Cookiecutter for Poetry projects.
Roff
8
star
27

pdm-multirun

A PDM plugin to run a command on multiple Python versions.
Python
8
star
28

failprint

Run a command, print its output only if it fails.
Python
8
star
29

neopy

Neo4j for Python. Manipulate graph data in Python with Neo4j as data storage.
Python
7
star
30

django-cerberus-ac

Django Cerberus Access Control, extended permission system.
JavaScript
7
star
31

ansito

Transform ANSI codes to any other format (currently only Conky style)
Python
7
star
32

stars

My stars on GitHub, grouped by language.
6
star
33

yore

Manage legacy code with comments.
Python
5
star
34

mkdocs-pygments

Highlighting themes for code blocks. Available to sponsors only.
Python
5
star
35

django-cs-models

A Django app that helps you creating models within a Complex System
Python
4
star
36

privibot

A Python library to add a privilege/permission system to your Telegram bot.
Python
4
star
37

shelldemo

Run a set of Bash commands as if typed by a robo- I mean, a person.
Shell
4
star
38

wps-light

The strictest and most opinionated python linter ever! (lighter fork)
Python
4
star
39

gestion-de-stock

Graphical UI in Qt for database management
C++
3
star
40

logan

Log analysis tool (alpha).
HTML
3
star
41

happy-path

Code and data flow visualization tool for Python. Available to sponsors only.
3
star
42

github-labels

The source of truth for labels in my GitHub projects.
2
star
43

rosetta-suit

Integration of django-rosetta into django-suit admin interface
HTML
2
star
44

suit-dashboard-demo

Demo site using django-suit-dashboard
Shell
2
star
45

fastapi-ref

API reference of FastAPI.
2
star
46

pawamoy.github.io

HTML
2
star
47

mvodb

Rename and move files using metadata from online databases.
Python
2
star
48

odoo-matrix

D3.js visualization for Odoo's inter-dependencies
Python
2
star
49

pypi-insiders

Self-hosted PyPI server with automatic updates for Insiders versions of projects. Only available to sponsors.
2
star
50

cookiecutter-cookiecutter

The cookiecutter that generated itself.
Python
1
star
51

django-access-control

Control how users access resources in your Django project
Python
1
star
52

mkdocs-manpage

MkDocs plugin to generate a manpage from the documentation site.
Python
1
star
53

pawamoy

My profile readme.
Shell
1
star
54

archan-pylint

Archan plugin for Pylint (number of messages per module).
Python
1
star
55

taskhub

[ALPHA] Task management tool, supporting import/export from/to different services, with multiple interfaces.
Python
1
star
56

cookiecutter-pypackage

Roff
1
star
57

Omnidia

Abstract elements manager (multimedia, data, stuff) in browser
HTML
1
star
58

mkdocs-logging

Logging utilities for MkDocs plugins.
Python
1
star
59

fulfill

Manage your project. Fulfill your duties.
Python
1
star
60

devboard

A development dashboard for your projects. Available to sponsors only.
1
star
61

keycut

A command line tool that helps you remembering ALL the numerous keyboard shortcuts of ALL your favorite programs
Python
1
star