Update dependencies
accounts: fix imports
Add alpine.js framework
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
).
Install dependencies in a virtual environment.
poetry install
Initialize database and create super user.
poetry run python manage.py migrate
poetry run python manage.py createsuperuser
Run server (webpages reloaded on change).
poetry run python manage.py runserver
Run tailwind (stylesheet updated on change).
poetry run tailwindcss -c theme/tailwind/config.js -i theme/tailwind/style.css -o theme/static/css/style.css --watch
Generate dependencies file for production.
poetry export -f requirements.txt --output requirements.txt
Compile and minimise stylesheet for production.
poetry run tailwindcss -c theme/tailwind/config.js -i theme/tailwind/style.css -o theme/static/css/style.css --minify
Then follow https://nora.nckm.eu/django-deploy.html.
Create a new language file or update the existing one.
poetry 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
.
poetry run python manage.py compilemessages -l fr
Make and compile all language files at once.
poetry run python manage.py makemessages -a
poetry run python manage.py compilemessages
Execute all tests.
poetry run python manage.py test