Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/epicserve/django-base-site

The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.
https://github.com/epicserve/django-base-site

boilerplate django python starter-template tools vite

Last synced: 15 days ago
JSON representation

The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.

Awesome Lists containing this project

README

        

Django Base Site




CI


Documentation Status


license

**Documentation**: [django-base-site.readthedocs.org](http://django-base-site.readthedocs.org/)
**Source Code**: [github.com/epicserve/django-base-site](https://github.com/epicserve/django-base-site/)

---

The Django Base Site is an opinionated starter template to jump-start any new Django project. It has been lovingly
maintained for over twelve years and has been used to jump-start many other projects. Because it is organized logically,
it will help you and your team collaborate and stay organized as your project grows. All the best practices and tools
are used to help you save days of mundane setup and tooling! This Django boilerplate/starter template will help you or
your team deploy your site to production in minutes instead of days.

To get started, jump to the [installation](#installation) section or keep reading to learn more about the included
features.

## ✨ Features

### πŸ§‘β€πŸ’» Best Practices

* [Environs](https://github.com/sloria/environs) - Used for managing environment variables
* [Docker](https://www.docker.com/) - Docker Compose for development and a multi-stage Dockerfile for production ready
Docker image
* [UV](https://github.com/astral-sh/uv) - Used to maintain python requirements
* [Just](https://github.com/casey/just) - Popular tool for running common commands (make equivalent)

### πŸ“¦οΈ Django Packages

* [Django 5](https://www.djangoproject.com/) - Latest version of Django
* [Celery](http://docs.celeryproject.org/) - Most popular task runner for running asynchronous tasks in the background
* [Custom User Model][custom_user_model] - Custom user model so that the user model can be easily extended
* [Django Allauth](http://www.intenct.nl/projects/django-allauth/) - The most popular package for adding authentication
workflows to a Django project
* [Django Crispy Forms](https://github.com/django-crispy-forms/django-crispy-forms) - The most popular helper for working with Django forms
* [Django Alive](https://github.com/lincolnloop/django-alive/) - A simple health check package for Django
* [Django Maintenance Mode](https://github.com/fabiocaccamo/django-maintenance-mode) - A simple maintenance mode package for Django

[custom_user_model]: https://docs.djangoproject.com/en/stable/topics/auth/customizing/#substituting-a-custom-user-model

### πŸ”§ Python Testing Tools

* [Pytest](https://docs.pytest.org/) - The most popular Python test runner in the Python community
* [Pytest Django](https://pytest-django.readthedocs.io/en/latest/index.html) - A Django plugin for Pytest
* [Pytest-cov](https://pytest-cov.readthedocs.io) - Adds code coverage to tests
* [Model Bakery](https://github.com/model-bakers/model_bakery) - A faster way to create model instances for tests
* [Django Test Plus](https://github.com/revsys/django-test-plus/) - Helper functions to write tests faster

### 🩺 Code Quality, Formatting, and Linting Tools

* [Ruff](https://github.com/charliermarsh/ruff) - Python formatting and linting. Lighting fast because it's written in Rust! Replaces Black and other tools.
* [Mypy](http://mypy-lang.org/) - Python Type checking
* [dj Lint](https://djlint.com/) - Automatic Django HTML template formatting and linting
* [Django Debug Toolbar](https://github.com/jazzband/django-debug-toolbar) - A toolbar for debugging and
optimizing Django queries
* [Stylelint](https://stylelint.io/) - Automatic Sass formatting and linting
* [Eslint](https://eslint.org/) - Automatic Javascript formatting and linting

### πŸ’„Frontend

* [Bootstrap 5](https://getbootstrap.com/) - A popular UI framework
* [Vite](https://vitejs.dev/) - A fast frontend build tool

### πŸ“ Documentation

The Django Base Site uses [MkDocs](https://www.mkdocs.org/) for documentation. You can copy the
[config file](https://github.com/epicserve/django-base-site/blob/main/config/mkdocs.yml) and the
[docs](https://github.com/epicserve/django-base-site/tree/main/docs) directory to help jumpstart the documentation for
your new project. The following are MkDocs plugins being used:

* [MkDocs Material](https://squidfunk.github.io/mkdocs-material/) - Beautify MkDocs theme
* [mkdocstrings](https://mkdocstrings.github.io/) - Build documentation from Python docstrings
* [mkdocs-include-markdown-plugin](https://github.com/mondeja/mkdocs-include-markdown-plugin) - Include docs from other
files
* [mkdocs-linkcheck](https://github.com/byrnereese/linkchecker-mkdocs) - Automatic link checking

## Installation

### Requirements

Before proceeding make sure you have installed [Docker](https://docs.docker.com/engine/installation/) and
[Just](https://github.com/casey/just#installation). Docker with Docker Compose is used for local development and Just is
used common project commands.

### Quickstart Install Script

Copy and past the following into your terminal to run the install script:

```bash
bash <(curl -s https://raw.githubusercontent.com/epicserve/django-base-site/main/scripts/start_new_project)
```

Running the script mostly does the same thing as manual method. The exception is that the install script has
questions to customize your new project setup.

**Note:** When starting the Django runserver it will take several seconds before the CSS styles take effect. This is
because Vite is running in dev mode which takes a few seconds to take effect.

Example output:

$ cd ~/Sites
$ bash <(curl -s https://raw.githubusercontent.com/epicserve/django-base-site/main/scripts/start_new_project)

What is the project name slug [example]?
What directory do you want your project in [/Users/brento/Sites/example]?

Done.

To start Docker Compose run:
$ cd /Users/brento/Sites/example
$ just start

### Manual Installation

$ curl -LOk https://github.com/epicserve/django-base-site/archive/main.zip && unzip main
$ mv django-base-site-main example
$ cd example
$ export SECRET_KEY=$(python -c "import random; print(''.join(random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%^&*(-_=+)') for i in range(50)))")
$ cat > .env <