django-twc-project
is the project template for all web applications at The Westervelt Company. This template is built on top of the Django web framework and is designed to be a starting point for new web applications. It includes a number of best practices and tools to help you get started quickly.
It is tailored to the needs of The Westervelt Company and is not intended for general use. However, it is open source and available for anyone take inspiration from or use and modify. For the greater good!
This template is built using Copier and includes the following features:
- Django
django-allauth
for user authenticationdjango-click
for nicer management commandsdjango-email-relay
for sending emails via a central database queuedjango-filter
for filtering querysetsdjango-health-check
for application, database, storage, and other health checksdjango-q2
for a task queue, using the built-in database brokercroniter
for cron tasks
django-simple-history
for tracking historical changes to modelsdjango-storages
for file storage using S3django-template-partials
for easy template partialsenvirons
for configuration via environment variablesheroicons
for easy access to Heroicons in Django templateshttpx
for making HTTP requestsneapolitan
for quick and easy CRUD viewssentry-sdk
for error trackingwhitenoise
for serving static files from Django- Also includes the following packages to make development easier:
django-browser-reload
for getting that HMR feeling in Djangodjango-debug-toolbar
, 'nuff saiddjango-extensions
for various management commands, but let's be honest -- it's mainly forshell_plus
coverage
anddjango-coverage-plugin
for test coverageipython
for a better shellmodel_bakery
for easy model creation in testsmypy
anddjango-stubs
for static type checkingpytest
for testingpytest-django
for Django pytest helperspytest-is-running
, what it says on the tinpytest-randomly
andpytest-reverse
for keeping tests honestpytest-xdist
for parallel testing, because ain't nobody got time for a slow test suite
- HTMX with
django-htmx
- Alpine.js
- Tailwind CSS with
django-tailwind-cli
- (optional) Vite with
django-vite
- Dependency management with
pip-tools
- Dependabot for automatic dependency updates
- Documentation built with
Sphinx
,MyST-Parser
, and thefuro
theme - Automatic linting and formatting via
pre-commit
blacken-docs
becauseruff
doesn'tdjango-upgrade
for keeping Django up to date automaticallydjlint
for linting and formatting Django templatesruff
for blazingly fast formatting and lintingprettier
for formatting CSS, JavaScript, TypeScript, and YAMLrustywind
for sorting Tailwind CSS classes automaticallyvalidate-pyproject
for ensuring thatpyproject.toml
is validpretty-format-toml
vialanguage-formatters-pre-commit-hooks
for TOML formatting
- Docker for local development and deployment
- A multi-stage
Dockerfile
to targeting different use cases (application/tailwind/vite/worker in development, full image in production)- Tailscale included for easy access to private nodes on Tailnet
- A
docker-compose.yml
file for local development, with adocker-compose.prod.yml
to simulate production
- A multi-stage
just
for running common development tasks- Deployment to Fly.io with a
fly.toml
file, withdjango-flyio
giving some niceties specific to Fly - CI/CD with GitHub Actions
- Testing
- Type checking
- Django deployment checks
- Deploying to Fly.io
bumpver
for version bumping- 1Password and the
1password/load-secrets-action
to manage secrets
To use this template, you will need to install Copier and then run the following command:
copier copy gh:westerveltco/django-twc-project <destination>
Examples are provided in the examples
directory.
As this template is mainly for internal use at The Westervelt Company, we do not generally accept contributions from external sources. However, if you have any suggestions or issues, please feel free to open an issue or pull request.
django-twc-project
is licensed under the MIT License. See the LICENSE file for more information.