Skip to content

Commit abe4fd6

Browse files
release v2024.1 (#2)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 28a6418 commit abe4fd6

File tree

13 files changed

+246
-26
lines changed

13 files changed

+246
-26
lines changed

.editorconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[{,.}{j,J}ustfile]
12+
indent_size = 4
13+
14+
[*.{py,rst,ini,md}]
15+
indent_size = 4
16+
17+
[*.py]
18+
line_length = 120
19+
multi_line_output = 3
20+
21+
[*.{css,html,js,json,jsx,sass,scss,svelte,ts,tsx,yml,yaml}]
22+
indent_size = 2
23+
24+
[*.md]
25+
trim_trailing_whitespace = false
26+
27+
[{Makefile,*.bat}]
28+
indent_style = tab

AUTHORS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Authors
2+
3+
- Josh Thomas <[email protected]>
4+
5+
Special thanks to Jeff Triplett [@jefftriplett](https://github.com/jefftriplett) for his help.

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6+
7+
<!--
8+
## [Version Number]
9+
10+
### Added
11+
### Changed
12+
### Deprecated
13+
### Removed
14+
### Fixed
15+
### Security
16+
-->
17+
18+
## [Unreleased]
19+
20+
## [2024.1]
21+
22+
Initial release! 🎉
23+
24+
### Added
25+
26+
- Initial project template.
27+
- Initial documentation.
28+
- Initial tests.
29+
- Initial CI/CD (GitHub Actions).
30+
31+
### New Contributors!
32+
33+
- Josh Thomas <[email protected]> (maintainer)
34+
35+
[unreleased]: https://github.com/westerveltco/django-twc-project/compare/v2024.1...HEAD
36+
[2024.1]: https://github.com/westerveltco/django-simple-nav/releases/tag/v2024.1

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,90 @@
22

33
[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json)](https://rye-up.com)
44
[![Copier](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/joshuadavidthomas/7c88611504b557ff7aa2a7524ad996e2/raw/4ba6834953dd8a14afc3dbb7bb41f49f181a59bf/badge.json)](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.

RELEASING.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Releasing a New Version
2+
3+
When it comes time to cut a new release, follow these steps:
4+
5+
1. Create a new git branch off of `main` for the release.
6+
7+
Prefer the convention `release-<version>`, where `<version>` is the next incremental version number (e.g. `release-v2024.1` for version 2024.1).
8+
9+
```shell
10+
git checkout -b release-v<version>
11+
```
12+
13+
However, the branch name is not *super* important, as long as it is not `main`.
14+
15+
2. Update the version number across the project using the `bumpver` tool.
16+
17+
The `pyproject.toml` in the base of the repository contains a `[tool.bumpver]` section that configures the `bumpver` tool to update the version number wherever it needs to be updated and to create a commit with the appropriate commit message.
18+
19+
`bumpver` is included as a development dependency, so you should already have it installed if you have installed the development dependencies for this project. If you do not have the development dependencies installed, you can install them with the following command:
20+
21+
```shell
22+
python -m pip install -r requirements-dev.lock
23+
```
24+
25+
Then, run `bumpver` to update the version number, with the appropriate command line arguments. See the [`bumpver` documentation](https://github.com/mbarkhau/bumpver) for more details.
26+
27+
**Note**: For any of the following commands, you can add the command line flag `--dry` to preview the changes without actually making the changes.
28+
29+
Here are the most common commands you will need to run:
30+
31+
```shell
32+
bumpver update
33+
```
34+
35+
To release a tagged version, such as a beta or release candidate, you can run:
36+
37+
```shell
38+
bumpver update --tag=beta
39+
# or
40+
bumpver update --tag=rc
41+
```
42+
43+
Running these commands on a tagged version will increment the tag appropriately, but will not increment the version number.
44+
45+
To go from a tagged release to a full release, you can run:
46+
47+
```shell
48+
bumpver update --tag=final
49+
```
50+
51+
3. Ensure the [CHANGELOG](https://github.com/westerveltco/django-twc-project/blob/main/CHANGELOG.md) is up to date. If updates are needed, add them now in the release branch.
52+
53+
4. Create a pull request from the release branch to `main`.
54+
55+
5. Once CI has passed and all the checks are green ✅, merge the pull request.
56+
57+
6. Draft a [new release](https://github.com/westerveltco/django-twc-project/releases/new) on GitHub.
58+
59+
Use the version number with a leading `v` as the tag name (e.g. `v2024.1`).
60+
61+
Allow GitHub to generate the release title and release notes, using the 'Generate release notes' button above the text box. If this is a final release coming from a tagged release (or multiple tagged releases), make sure to copy the release notes from the previous tagged release(s) to the new release notes (after the release notes already generated for this final release).
62+
63+
If this is a tagged release, make sure to check the 'Set as a pre-release' checkbox.
64+
65+
7. Once you are satisfied with the release, publish the release.

examples/default/fly.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
app = "default-example_owner"
2-
primary_region = "atl"
2+
console_command = "/app/manage.py shell_plus"
33
kill_signal = "SIGINT"
44
kill_timeout = "5s"
5-
console_command = "/app/manage.py shell_plus"
5+
primary_region = "atl"
66

77
[deploy]
88
release_command = "/release.sh"
@@ -40,12 +40,12 @@ handlers = ["http"]
4040
port = 80
4141

4242
[[services.ports]]
43-
port = 443
4443
handlers = ["tls", "http"]
44+
port = 443
4545

4646
[[services.tcp_checks]]
47-
interval = "15s"
4847
grace_period = "1s"
48+
interval = "15s"
4949
restart_limit = 0
5050
timeout = "2s"
5151

examples/default/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ indent = 2
2020
[tool.mypy]
2121
check_untyped_defs = true
2222
files = [
23-
"default",
23+
"default"
2424
]
2525
no_implicit_optional = true
2626
plugins = [
@@ -34,7 +34,7 @@ warn_unused_ignores = true
3434
ignore_errors = true
3535
module = [
3636
"default.*.migrations.*",
37-
"tests.*",
37+
"tests.*"
3838
]
3939

4040
[[tool.mypy.overrides]]
@@ -46,7 +46,7 @@ module = [
4646
"django_q.*",
4747
"djclick.*",
4848
"gunicorn.*",
49-
"health_check.*",
49+
"health_check.*"
5050
]
5151

5252
[tool.mypy_django_plugin]

examples/default/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from __future__ import annotations
22

33
import logging
4-
import pytest
54

5+
import pytest
66
from django.test.utils import override_settings
77

8-
98
pytest_plugins = [] # type: ignore
109

1110

examples/with_vite/fly.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
app = "with_vite-example_owner"
2-
primary_region = "atl"
2+
console_command = "/app/manage.py shell_plus"
33
kill_signal = "SIGINT"
44
kill_timeout = "5s"
5-
console_command = "/app/manage.py shell_plus"
5+
primary_region = "atl"
66

77
[deploy]
88
release_command = "/release.sh"
@@ -40,12 +40,12 @@ handlers = ["http"]
4040
port = 80
4141

4242
[[services.ports]]
43-
port = 443
4443
handlers = ["tls", "http"]
44+
port = 443
4545

4646
[[services.tcp_checks]]
47-
interval = "15s"
4847
grace_period = "1s"
48+
interval = "15s"
4949
restart_limit = 0
5050
timeout = "2s"
5151

examples/with_vite/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ indent = 2
2020
[tool.mypy]
2121
check_untyped_defs = true
2222
files = [
23-
"with_vite",
23+
"with_vite"
2424
]
2525
no_implicit_optional = true
2626
plugins = [
@@ -34,7 +34,7 @@ warn_unused_ignores = true
3434
ignore_errors = true
3535
module = [
3636
"with_vite.*.migrations.*",
37-
"tests.*",
37+
"tests.*"
3838
]
3939

4040
[[tool.mypy.overrides]]
@@ -46,7 +46,7 @@ module = [
4646
"django_q.*",
4747
"djclick.*",
4848
"gunicorn.*",
49-
"health_check.*",
49+
"health_check.*"
5050
]
5151

5252
[tool.mypy_django_plugin]

0 commit comments

Comments
 (0)