|
2 | 2 |
|
3 | 3 | [](https://rye-up.com) |
4 | 4 | [](https://copier.readthedocs.io) |
| 5 | + |
| 6 | +`django-twc-project` is the project template for all web applications at The Westervelt Company. This template is built on top of the [Django](https://www.djangoproject.com/) 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. |
| 7 | + |
| 8 | +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!](https://youtu.be/5u8vd_YNbTw?si=lBqwaHdT8y8JUg9q) |
| 9 | + |
| 10 | +## Features |
| 11 | + |
| 12 | +This template is built using [Copier](https://copier.readthedocs.io) and includes the following features: |
| 13 | + |
| 14 | +- [Django](https://www.djangoproject.com/) |
| 15 | + - [`django-allauth`](https://github.com/pennersr/django-allauth) for user authentication |
| 16 | + - [`django-click`](https://github.com/GaretJax/django-click) for nicer management commands |
| 17 | + - [`django-email-relay`](https://github.com/westerveltco/django-email-relay) for sending emails via a central database queue |
| 18 | + - [`django-filter`](https://github.com/carltongibson/django-filter) for filtering querysets |
| 19 | + - [`django-health-check`](https://github.com/revsys/django-health-check) for application, database, storage, and other health checks |
| 20 | + - [`django-q2`](https://github.com/django-q/django-q) for a task queue, using the built-in database broker |
| 21 | + - [`croniter`](https://github.com/kiorky/croniter) for cron tasks |
| 22 | + - [`django-simple-history`](https://github.com/jazzband/django-simple-history) for tracking historical changes to models |
| 23 | + - [`django-storages`](https://github.com/jschneier/django-storages) for file storage using S3 |
| 24 | + - [`django-template-partials`](https://github.com/carltongibson/django-template-partials) for easy template partials |
| 25 | + - [`environs`](https://github.com/sloria/environs) for configuration via environment variables |
| 26 | + - [`heroicons`](https://github.com/adamchainz/heroicons) for easy access to [Heroicons](https://heroicons.com/) in Django templates |
| 27 | + - [`httpx`](https://github.com/encode/httpx) for making HTTP requests |
| 28 | + - [`neapolitan`](https://github.com/carltongibson/neapolitan) for quick and easy CRUD views |
| 29 | + - [`sentry-sdk`](https://sentry.io) for error tracking |
| 30 | + - [`whitenoise`](https://github.com/evansd/whitenoise) for serving static files from Django |
| 31 | + - Also includes the following packages to make development easier: |
| 32 | + - [`django-browser-reload`](https://github.com/adamchainz/django-browser-reload) for getting that HMR feeling in Django |
| 33 | + - [`django-debug-toolbar`](https://github.com/jazzband/django-debug-toolbar), 'nuff said |
| 34 | + - [`django-extensions`](https://github.com/django-extensions/django-extensions) for various management commands, but let's be honest -- it's mainly for `shell_plus` |
| 35 | + - [`coverage`](https://github.com/nedbat/coveragepy) and [`django-coverage-plugin`](https://github.com/nedbat/django_coverage_plugin) for test coverage |
| 36 | + - [`ipython`](https://github.com/ipython/ipython) for a better shell |
| 37 | + - [`model_bakery`](https://github.com/model-bakers/model_bakery) for easy model creation in tests |
| 38 | + - [`mypy`](https://github.com/python/mypy) and [`django-stubs`](https://github.com/typeddjango/django-stubs) for static type checking |
| 39 | + - [`pytest`](https://github.com/pytest-dev/pytest) for testing |
| 40 | + - [`pytest-django`](https://github.com/pytest-dev/pytest-django) for Django pytest helpers |
| 41 | + - [`pytest-is-running`](https://github.com/adamchainz/pytest-is-running), what it says on the tin |
| 42 | + - [`pytest-randomly`](https://github.com/pytest-dev/pytest-randomly) for keeping tests honest |
| 43 | + - [`pytest-xdist`](https://github.com/pytest-dev/pytest-xdist) for parallel testing, because ain't nobody got time for a slow test suite |
| 44 | +- [HTMX](https://htmx.org/) with [`django-htmx`](https://github.com/adamchainz/django-htmx) |
| 45 | +- [Alpine.js](https://alpinejs.dev/) |
| 46 | +- [Tailwind CSS](https://tailwindcss.com/) with [`django-tailwind-cli`](https://github.com/oliverandrich/django-tailwind-cli) |
| 47 | +- (optional) [Vite](https://vitejs.dev/) with [`django-vite`](https://github.com/MrBin99/django-vite) |
| 48 | +- Dependency management with [`pip-tools`](https://github.com/jazzband/pip-tools) |
| 49 | + - [Dependabot](https://dependabot.com/) for automatic dependency updates |
| 50 | +- Documentation built with [`Sphinx`](https://github.com/sphinx-doc/sphinx), [`MyST-Parser`](https://github.com/executablebooks/MyST-Parser), and the [`furo`](https://github.com/pradyunsg/furo) theme |
| 51 | +- Automatic linting and formatting via [`pre-commit`](https://github.com/pre-commit/pre-commit) |
| 52 | + - [`blacken-docs`](https://github.com/adamchainz/blacken-docs) because `ruff` doesn't |
| 53 | + - [`django-upgrade`](https://github.com/adamchainz/django-upgrade) for keeping Django up to date automatically |
| 54 | + - [`djlint`](https://github.com/rtts/djlint) for linting and formatting Django templates |
| 55 | + - [`ruff`](https://github.com/astral-sh/ruff) for blazingly fast formatting and linting |
| 56 | + - [`prettier`](https://github.com/prettier/prettier) for formatting CSS, JavaScript, TypeScript, and YAML |
| 57 | + - [`rustywind`](https://github.com/avencera/rustywind) for sorting Tailwind CSS classes automatically |
| 58 | + - [`validate-pyproject`](https://github.com/abravalheri/validate-pyproject) for ensuring that `pyproject.toml` is valid |
| 59 | + - `pretty-format-toml` via [`language-formatters-pre-commit-hooks`](https://github.com/macisamuele/language-formatters-pre-commit-hooks) for TOML formatting |
| 60 | +- [Docker](https://www.docker.com/) for local development and deployment |
| 61 | + - A multi-stage `Dockerfile` to targeting different use cases (application/tailwind/vite/worker in development, full image in production) |
| 62 | + - A `docker-compose.yml` file for local development, with a `docker-compose.prod.yml` to simulate production |
| 63 | +- [`just`](https://github.com/casey/just) for running common development tasks |
| 64 | +- Deployment to [Fly.io](https://fly.io) with a `fly.toml` file, with [`django-flyio`](https://github.com/joshuadavidthomas/django-flyio) giving some niceties specific to Fly |
| 65 | +- CI/CD with [GitHub Actions](https://github.com/features/actions) |
| 66 | + - Testing |
| 67 | + - Type checking |
| 68 | + - Django deployment checks |
| 69 | + - Deploying to Fly.io |
| 70 | + - [`bumpver`](https://github.com/mbarkhau/bumpver) for version bumping |
| 71 | + - [1Password](https://1password.com) and the [`1password/load-secrets-action`](https://github.com/1password/load-secrets-action) to manage secrets |
| 72 | + |
| 73 | +## Usage |
| 74 | + |
| 75 | +To use this template, you will need to install [Copier](https://copier.readthedocs.io) and then run the following command: |
| 76 | + |
| 77 | +```bash |
| 78 | +copier copy gh:westerveltco/django-twc-project <destination> |
| 79 | +``` |
| 80 | + |
| 81 | +## Examples |
| 82 | + |
| 83 | +Examples are provided in the [`examples`](examples) directory. |
| 84 | + |
| 85 | +## Contributing |
| 86 | + |
| 87 | +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. |
| 88 | + |
| 89 | +## License |
| 90 | + |
| 91 | +`django-twc-project` is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information. |
0 commit comments