All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
- Changed the default for Postgres connection pooling to default to
False
for now. We are having issues with our PG setup with our applications that use this template, so while that is being troubleshot we will default to not using pooling. - Added
--depot=false
to Fly.io deploy command. The new Depot builders are either a) buggy as all hell, or b) not agreeable with how our currentDockerfile
is setup.
- Removed
conn_max_age
argument when configuring database connection if Django version is greater than 5.1. In that case, we enable connection pooling and theconn_max_age
setting causes the application to error with adjango.core.exceptions.ImproperlyConfigured: Pooling doesn't support persistent connections.
exception.
- Added a new settings constant
PROD
that is just the inverse ofDEBUG
, e.g.not DEBUG
. Purely to aid in readability of some of the settings which are only enabled when not in debug mode (cookies and whatnot). - Added a new settings constant
CI
for adjusting behavior that needs it when running in CI. - If Django 5.1 is selected, add
pool
extra topsycopg
dependency and enable connection pooling in settings. - The
Justfile
now has ajust prod
module with common commands for interacting with the production application. - The setting for
CACHES
is now present in the project settings, grabbing the value from the environment variableCACHE_URL
and defaulting to the local memory.
- Bumped all versions of the hooks in
.pre-commit-config.yaml
. - Altered all uses of the
--cov
pytest
CLI flag frompytest-cov
. This was unneeded as just by using the bare flag, the plugin uses the coverage configuration inpyproject.toml
. - Coverage just commands in
.just/python.just
module have been shortened fromcoverage
tocov
. - Make sure that when specifying
dj
when callingjust shell
as the container to enter, actually enter theapp
container and call theshell_plus
command.
- Removed the
just refresh
command due to the vast overlap between it and thejust update
command. - The
test
command in.just/python.just
has been removed as a prereq to the coverage commands. Depending on the order these are called, you could end up running the test suite more than once, defeating the purpose of the prereq. So we will just rely on calling the test command before the coverage commands.
- Actually use the
dev
extra inpy-dev
stage withinDockerfile
, instead of thedocs
extra. 🤦
just refresh
command now callsjust lock
.- Now defaults to 3.4.9 for Tailwind CSS version.
- Now defaults to 1.46.0 for Playwright version.
- Now defaults to v2024.8.27 for
django-twc-ui
version. - Instead of using a dictionary of settings specific to tests with
django.test.utils.override_settings
, there is now a dedicatedtests/settings.py
that imports the project's mainsettings.py
and overrides with test specific ones. When trying to usedjango-q2
andpytest-xdist
, there seems to be a bug between the two when also usingoverride_settings
. The override for sync mode in q2 does not seem to be respected. This has led to inconsistent behavior when testing parts of the project that useasync_task
from q2 to offload tasks to the background, e.g. sending email via anasync_task
and not being able to check themailoutbox
.
- Installation for development stages in
Dockerfile
now correctly usingpyproject.toml
withdev
extras.
- Instead of generating a separate requirements file for both the
dev
anddocs
extras, we now only generate a requirements file for the primary production dependencies and use the ability ofuv pip install
to install directly from apyproject.toml
file in development. The production requirements are used as a constraint, so there should be no version mismatches.
- Added
pytest-cov
as dev dependency. - Added
branch=True
to coverage configuration. - Django 5.1 is now available as a version choice when generating template.
- Adjusted default
pytest
command line arguments to includepytest-cov
flags, with the default not printing the report to the terminal. - Changed
just py test
command to erase coverage before each run and to get rid of callingcoverage
directly in favor ofpytest-cov
. - Always upload coverage html report in CI tests instead of just on failure.
- Added the documentation
just docs lock
subcommand to the top-level Justfilejust lock
command and adjusted calls to individuallock
commands to this top-level command.
- All
uv pip install
commands now use the correct CLI syntax for installing from requirements files. When I migrated back fromuv pip sync
I failed to take in to account the slight differences between how dependencies are installed.
- Add
--constraint requirements.txt
to the compiling of the two extra requirements files, to constrain the dependencies to the versions specified in the primary requirements file. - Switch back from
uv pip sync
touv pip install
for dependency installation.uv pip sync
itself is quite strict, only installing exactly what's specified in a given requirements file. This is fine, except if something likepip
is installed in the virtual environment but not listed as a dependency, it will gladly uninstall it from the venv. I get why they do this, but it makes no sense for local installations to clobber any packages that may already be installed in the venv. In the future, we may consider usinguv pip sync
in environments where it makes sense to allow this behavior, e.g. in theDockerfile
or CI.
- Fixed arguments surrounded by curly braces in
Justfile
template by wrapping with{% raw %}{% endraw %}
Jinja2 code.
- Added
copier
andcopier-templates-extensions
todev
extras inpyproject.toml
. - Added
django-perf-rec
todev
extras inpyproject.toml
. - Added
pip
anduv
todev
extras inpyproject.toml
.
- Added a new
py-dev
stage to theDockerfile
for installation of development dependencies. All intermediate stages afterwards now rely on the Python packages installed in this stage, with the exception of the final stage which only copies the production dependencies from thepy
stage.
- Now using
django_twc_toolbox.views
for some core views. See the removed section below. - Now using Sentry sampler functions from
django_twc_toolbox.sentry
. See the removed section below. - Moved from recommending setting the
JUST_UNSTABLE=True
environment variable to usingset unstable := true
within template project'sJustfile
.
- Fixed reference to correct
lock
command injust docs upgrade
just command. - Changed the
default-app
build target fromapp
todev
. This fixes an error running the stack in development where the worker container does not have the development dependencies installed.
- Removed all views except the
index
view from the template project'score/views.py
, in favor ofdjango_twc_toolbox.views
. - Removed Sentry sampler functions.
- Pinned
django-storages<1.14.4
due to some recent changes introduced in the base storages backend of Django. Relevant issues: revsys/django-health-check#434 and jschneier/django-storages#1430.
- Prettier pre-commit stage in
.pre-commit-config.yaml
has been temporarily commented out and disabled. The pre-commit mirror this originally was pointing at was deprecated, and the Prettier project does not have an official one. I tried my hand at creating a local hook, but I have run in to issues with it actually running. Disabling for now till I have the time to dig in to what to do here.
- Added
persist-credentials: false
back to theactions/checkout
step in thetest
step in thetest.yml
GitHub Action workflow. Persisting the default GitHub Token credentials causes an error when trying to install Node dependencies, as ourdjango-twc-ui/tailwind
dependency is in a private repository. - Removed the Jinja2 templating in
.just/documentation.just
file, as it's unused and causes the commands to fail. - Fixed bot check in GitHub Actions workflows.
- Adjusted how the
SECRET_KEY
is formatted within the template'ssettings.py
. When updating a project that uses this template, this part of the file is always a merge conflict as after ruff formats the file it get's split across newlines due to the length of the secret key automatically generated by this template. Hopefully this will remove the need to manually intervene every single time for these lines. - Fixed the reference to the cache dir output from
py-cache
touv-cache
in thetests.yml
GitHub Actions workflow.
semgrep.yml
GitHub Actions workflow is now skipped if triggered by either Dependabot or the pre-commit-ci bot.
- Created a new GitHub Team for documentation and added it to the
CODEOWNERS
file in the project template.
- Removed
westerveltco/setup-ci-action@simplify
action withintest.yml
GitHub Actions workflow in favor of explicitly running actions directly.
- Migrated docs requirements to
pyproject.toml
, to match prod and dev dependencies.
- Added
django-stubs-ext
to production dependencies. - Added new question about
django-twc-ui
version.
- Added
custom_html = "c-\\w+"
to thedjlint
config, to support the HTML tags produced from our custom Django Cotton components. - Set both
SHOW_COLLAPSED
andUPDATE_ON_FETCH
toTrue
in thedjango-debug-toolbar
config, to prevent the toolbar from showing on all navigation and to make sure it's updated on HTMX fetch requests. - Moved development dependency
django_browser_reload
behindDEBUG
check. - Moved
django_extensions
to production dependency. - Now using
simplify
branch ofwesterveltco/setup-ci-action
GitHub Action. - Added
[tables]
extra todjango-twc-ui
. - Added
[crud]
extra todjango-twc-toolbox
. - Shuffled around the order of
INSTALLED_APPS
to ensure our UI templates have priority over any other installed third-party library.
- Our
neapolitan
for is in the process of being abandoned in favor of a customneapolitan.views.CRUDView
indjango_twc_toolbox.crud
. The fork has been removed from the dependencies.
- Now explicitly adding
template_partials.loader.Loader
to the template loaders section ofsettings.TEMPLATES
. This is to support trying out a few component libraries that use custom loaders and to avoiddjango-template-partials
from overwriting any changes. Also to avoid usingtemplate_partials.apps.SimpleAppConfig
inINSTALLED_APPS
as that would really bug me for it be the only one installed like that. Silly thing, but it would!
prettier
pre-commit hook is now local instead of using the official mirror. The mirror has been deprecated and archived.djlint
configuration expanded.
mypy
configuration now excludes these directories:docs
,migrations
,tests
, and.venv
/venv
.- Default Django version is now 5.0.
- Bumped default Playwright version to 1.45.0.
- Bumped default Tailwind CSS version to 3.4.6.
- Migrated defining dependencies from
requirements.in
topyproject.toml
. Split dev dependencies to project extras.
- Django 3.2 (EOL) has been removed as an option.
- Removed an out-of-date and unneeded
# type: ignore
comment from theusers.admin
module.
- Remove
mkdocs.yml
config from template. This is now being handled from the central docs repo and no longer needed.
- There is now a
mkdocs.yml
file that enables docs from this repo to be collected in another repo.
- Label syncing has been removed. This has been moved to a GitHub App using github/safe-settings.
- CI now has a new
fly
step that validates thefly.toml
configuration file.
- Removed the
[no-cd]
decoration from an alias in one of the sub-Justfile
s.
- Added
[no-cd]
to allJustfile
module subcommands. By default, ajust
command runs in the context of the file that it is contained it, which means the working directory for all of the module subcommands ends up being the.just
directory. This is not what we want. Annoyingly, there seems to be no way to change this, either globally or as a setting at the top of aJustfile
, so we instead have to decorate all of the commands. django-twc-toolbox
now a part of theINSTALLED_APPS
list. There was a management command added -- an override of the built-increatesuperuser
command that resets the superuser's password in development -- so it's added as an installed app so this command can be run.- Added a question for template generation on whether Cloudflare R2 will be used. If so, make sure the
STORAGES
setting insettings.py
has the correct keys for setting that up.
- Removed question about 1Password vault, which is no longer used.
- Added Semgrep CI GitHub Actions workflow.
- Updated
README.md
to account for recent changes toJustfile
commands. - In
.just/postgres.just
, added replacement in database URLs ofpostgis://
topostgres://
to account for potential PostGIS usage. When using the commands directly with thedb
container, there is no need for the PostGIS scheme.
- Removed GitHub branching strategy section from
README.md
. This has been moved to our central Web Dev documentation.
- Fixed
just pg dump-prod
command subcall ofjust pg dump
command.
- Fixed a bug in the changed
just docker clean
Justfile
command where the command was prefixed with an@
symbol. That is valid when it's a purejust
command, but it was changed to abash
script.
- Added our Data Analytics GitHub Team to the
CODEOWNERS
file for automatic review assignment to any PRs involving migrations.
- Adjusted various
Justfile
commands based on testing and feedback. depends_on
incompose.yml
now moved to a separate YAML anchor with the benefit of being able to extend it to include thenode
container when Vite is chosen.
- Adjusted the configuration of
django-storages
to use new style. At least, I think it's new. I cannot find in the library's CHANGELOG where it was added. django-storages
installation options adjusted to specify the[s3]
extra.- Major refactor to the
Justfile
. Now utilizing the new modules introduced in version 1.19.0 ofjust
.
boto3
as an explicit dependency has been removed in favor ofdjango-storages[s3]
.- Removed deprecated
version
property from all Dockercompose*.yml
files. - Dropped support for Python 3.8.
- Removed the
PORT
environment variable from the Fly.io config. It was unused and not needed.
- Added "high visibility" label.
- Added
socialaccount
extra todjango-allauth
dependency, per the breaking change outlined in the library's release notes.
- Removed deprecated
sentry_sdk.last_event_id
function from custom 500 error view.
- Added missing trailing slash when copying files in
Dockerfile
.
- Repo now has a
CODEOWNERS
file to automatically assign reviewers to pull requests. (Template already has one.) - Added a new, separate Dependabot group for
django-email-relay
updates. - Added Docker to Dependabot updates.
- Added
CSRF_COOKIE_SECURE = not DEBUG
setting to template. - Added
AWS_S3_CUSTOM_DOMAIN
setting to template. - Added "c-suite" label.
- Tweaked a few of the commands in the template's
Dockerfile
to consolidate the ones that could be. - Added the ability to specify repo specific labels, in addition to the global shared labels.
- Fixed a bug with the
ssl_require
argument in the database config insettings.py
. When building or testing, we sometimes fall back to just using SQLite to avoid having to spin up a Postgres database. However, SQLite doesn't know what to do with thesql_require
argument, so we disable it for SQLite.
- Added a GitHub Action workflow for syncing labels across all projects using this template.
- Added two CSS utilities previously set in the shared central Tailwind CSS config:
x-cloak
for hiding certain Alpine.js elements until Alpine has been initialized and thehtmx-indicator
for controlling the Z-index of the loading indicator.
tzdata
system utility package now explicitly installed in thedev
stage of the template'sDockerfile
. Previously all of the stages were based on thepython-slim
base image, which includestzdata
by default. Themcr.microsoft.com/playwright/python
image is based onubuntu
and does not includetzdata
by default.
- Pinned Django in
requirements.in
to less than the next major release based on the version chosen when answering copier questions. - Added more ignore rules to
.gitignore
pertaining to SQLite, PostgreSQL, and other database files.
- Now using official Playwright Docker image provided my Microsoft, instead of installing manually inside project's
Dockerfile
. The build times when updating any Python dependency got to be too long to deal with, so instead we pin which version of Playwright to use in bothrequirements.in
and the aforementionedDockerfile
so there is no drift between the two. just bootstrap
command in template now callsjust lock
to address when arequirements.txt
may not exist.
partialdef
template tag fromdjango-template-partials
has been added to the config fordjlint
.- Added Inter font to
base.html
template.
- Moved the Python and Node.js versions from arguments to
setup-ci-action
to environment variables at the top of the workflow to cut down on duplication intest.yml
GitHub Action workflow. .mise.toml
config files are now ignored by Git.SECRET_KEY
default now set at template generation time using copier extension instead of usingsecrets
stdlib module. This was causing login issues in development and is not really needed.bumpver
pattern for updating version in.copier/project.yml
now without quotes around version number. There must have been an internal change withcopier
.
uv
was removed fromrequirements.in
.
- Added S3 and Okta credentials to
.env.prod
. - Added the version specified in the Copier answers file
.copier/project.yml
tobumpver
config. Copier advises not to edit this file directly, however when updating a project to a new version of the template it is a bit of a pain to lookup what the current version is. Sincebumpver
bumps the project's version in every place it needs to, the risk that it messes up Copier is very low.
- Now calling
manage.py
file in CI as a module instead of using the file name directly.
- Added upper bounds for
django-email-relay
dependency. Since it runs distributed, with a central relay service that is responsible for sending emails, the roll-out of a new version should be more controlled. With the upper bounds, the version won't accidentally get bumped in day-to-day work (hopefully!).
- Adjusted all
Justfile
commands to only echo the command being run.
- Removed the template version from the main project's
__init__.py
since it is already captured in the copier answers file.
- A
.env.prod
template to be used with 1Password'sop
CLI tool.
- Now using 1Password's
op
CLI tool for managing and injecting secrets when deploying to Fly.io.
- Added more files to
coverage
exclude list. - Node.js/Vite specific files now excluded from
.dockerignore
.
- Template now has a
CODEOWNERS
file.
ENABLE_SENTRY
environment variable has been removed from template in favor of checking for the existence ofSENTRY_DSN
.
- Moved the
--skip-checks
flag indjango-tailwind-cli
's build command in CI/CD.
- Two new
Justfile
commands for usingcopier
's recopy command:copier-recopy
andcopier-recopy-all
. - All
Justfile
commands now have a short description that is displayed when runningjust
(default command) orjust --list
.
- Removed extra
test
command inJustfile
. - Fixed
compose.yml
filename in variousJustfile
commands.
- Now prompted for the version of PostGIS to use in the project, if
postgis/postgis
is chosen as the PostgreSQL database. - A new example project has been added to the
examples
directory using PostGIS.
- PostgreSQL version now takes into account the version of PostGIS, if that option is chosen.
django_browser_reload
middleware now only loaded in development (DEBUG=True
).template_partials
template loader has been removed in favor of built-in behavior. (The package automatically wraps the template loaders with the correct loader class.)- In
settings.py
, all reading of environment variables usingenvirons.env
now have the correct types associated with them. SECRET_KEY
now usessecrets
stdlib module to generate a new secret key if not set. H/T to @jacobian for the inspiration..dockerignore
now uses a whitelist of files to include, rather than a blacklist. H/T to @mhlut for the inspiration.- In
settings.py
,SENTRY_DSN
now correctly usingenvirons.env.url
to validate the URL from the environment and passing the URL string tosentry_sdk.init
. uv
explicitly added to template'srequirements.in
file.- Python 3.12 is now the default version in template and repo.
pip-tools
has been removed fromrequirements.in
, in favor ofuv
.
- Added missing
--no-default-ignore
to static collection step intest.yml
. By default Vite puts themanifest.json
in a.vite
directory, so we need to make sure this is not ignored when collecting static files. - Now correctly using
postgres_uri_scheme
throughout template.
- Now using v2 of
1password/load-secrets-action
GitHub Action. - Now using v0.3.2 of
ruff
in pre-commit. - Shortened all
docker-compose*.yml
files tocompose*.yml
files. This is the recommended file naming scheme now. - Tailwind CSS version now read from
package.json
anywhere the version is needed. - Playwright installation stage in
Dockerfile
moved to earlier stage with the dev stage inheriting from it later on. This allows for the system dependencies and browsers installation and building to be cached without anything in the project busting it.
project.yml
GitHub Actions workflow file. This is now taken care of by a custom GitHub bot.
- Now mirroring the
default
database when testing. This is the recommendation from the Django documentation. STORAGES["staticfiles"]["BACKEND"]
now correctly usingdjango.contrib.staticfiles.StaticFilesStorage
instead of theInMemoryStorage
backend. This was causing the static templatetag to look in themediafiles
directory instead of thestatic
directory.
- Default vm settings for Fly.io app now set to 1 shared CPU and 1GB RAM.
- Use
uv
for dependency management. playwright
added torequirements.in
for testing.
- Database connection now requires SSL connection by default in production.
- Adjust how
DISABLE_SERVER_SIDE_CURSORS
is set in dev and production settings. - Adjust how Sentry is configured and enabled.
- Always have one machine running in the Fly.io production environment.
[services.concurrency]
infly.toml
config now based on requests per Fly.io's recommendation for web services.
- No hash dependencies.
- The release link and text in the
README.md
was not referencing the correct SaaS product.
- Now using
westerveltco/setup-ci-action
for common Python and Node.js CI/CD setup. This action sets up a Python and Node.js environment with caching and installs all dependencies for a project. - Added example generation job to
test.yml
GitHub Actions workflow. - Initial
README.md
in the project template with basic information about the project and how to get started.
- Django commands in CI/CD now use
--skip-checks
and/or--no-input
where possible.
create-release-pr
command fromJustfile
was removed and moved to a personal script.
django-template-partials
added toINSTALLED_APPS
.- Added missing
coverage-py
report config topyproject.toml
.
- All GitHub Actions steps have been updated to the latest versions.
- Move from deprecated
ruff
config to new inpyproject.toml
.
- Minimum Copier version set to 9.1.0.
author_name
andgithub_owner
incopier.yml
now have inline validators to ensure they are not empty.FORM_RENDERER
is now set todjango.forms.renderers.TemplatesSetting
by default.- Test for version in
tests/test_version.py
now correctly bumped bybumpver
. django-q-registry
added torequirements.in
.django-twc-toolbox
added torequirements.in
.django-simple-nav
added torequirements.in
.- Add
coverage
config topyproject.toml
. - Add
boto3
andbotocore
tomypy
ignore list inpyproject.toml
. - Add some
ruff
per-file ignores for tests inpyproject.toml
. - Add rules for
pyupgrade
toruff
config inpyproject.toml
.
admin_email
help text incopier.yml
updated to be more clear that it's the destination for emails sent to Admins. This is primarily only used in thetemplates/.well-known/security.txt
file at the moment.- All
pre-commit
hooks have been updated to use the latest versions of the tools.django-upgrade
to 1.16.0language-formatters-pre-commit-hooks
to v2.12.0prettier
to v4.0.0-alpha.8ruff-pre-commit
to 0.2.1rustywind
to 0.21.0validate-pyproject
to v0.16
djhtml
has been swapped out in favor ofdjLint
for HTML formatting.pyproject.toml
has been linted and formatted.- Favicon view in
core.views
now usesdjango.contrib.staticfiles
to find the favicon file. pre-commit
is now run after generation to ensure the generated project is properly formatted.
DEFAULT_AUTO_FIELD
reverted todjango.db.models.AutoField
. We still have projects that have not migrated to the new field and this change was potentially breaking for them.- Redirect after login to "index" view instead of non-existent "dashboard" view.
- All HTML templates in
src/django_twc_project/templates
have been formatted using djLint. - Add missing
django-tailwind-cli
build command in CI/CD test job. - Actually use Copier
python_version
input forruff
Python target version inpyproject.toml
.
- Empty
{{ module_name }}/users/views.py
file has been removed.
Initial release! 🎉
- Initial project template.
- Initial documentation.
- Initial tests.
- Initial CI/CD (GitHub Actions).
- Josh Thomas josh@joshthomas.dev (maintainer)