core: fix htmx form reset
Update tailwindcss 4.0.3, alpinejs 3.14.8, htmx 2.0.4
Update dependencies and migrate to uv and ruff
This is a template to start a Django/Tailwind/Htmx/Alpine project.
This template includes the following features.
Clone template repository, modify some files, push modification on new repository.
git clone git@git.sr.ht:~nora/django-template new-project
cd new-project
rm -rf .git
# edit pyproject.toml and README.md
git init
git add .
git commit -m"Initial commit"
git remote add origin git@git.sr.ht:~nora/new-project
git push -u origin main
Create configuration file in config/.env
(example in config/.env.dist
).
Initialize database and create super user.
uv run python manage.py migrate
uv run python manage.py createsuperuser
Run server (webpages reloaded on change).
uv run python manage.py runserver
Run tailwind (stylesheet updated on change).
uv run tailwindcss -i theme/tailwind/style.css -o theme/static/css/style.css --watch
Install dependencies.
uv sync
Compile and minimise stylesheet for production.
uv run tailwindcss -i theme/tailwind/style.css -o theme/static/css/style.css --minify
Then follow https://nora.nckm.eu/django-deploy.html launching commands in the virtual environment with uv run
.
Create a new language file or update the existing one.
uv run python manage.py makemessages -l fr
Edit the file in locale/fr/LC_MESSAGES/django.po
.
Compile the file to locale/fr/LC_MESSAGES/django.mo
.
uv run python manage.py compilemessages -l fr
Make and compile all language files at once.
uv run python manage.py makemessages -a
uv run python manage.py compilemessages
Execute all tests.
uv run python manage.py test