start-django Docs
start-django.fly.dev ^3.11 4.2 + fly.io personal boilerplate, ft.:
- UI from django-fragments attempting locality-of-behavior:
{% icon %}-<svg>tag combiner{% themer %}-<button onclick=toggleTheme()>enclosing two{% icon %}s.{% hput %}- TailwindCSS + widget-tweakable<input>{% sel %}- hyperscript w/ aria-*<select>{% include '_msg.html' ... %}- -htmx messages
- Deployable fly.toml based on compose.yml
services:web: toggle settings: dev | test | proddb: sqlite default, postgres-configurableworker: huey background tasksredis: message broker
- Connected Custom User Model:
- django-allauth logic where UI templates have been styled.
- python-postmark transactional emails (e.g. confirm auth, change password, etc.)
- 1-to-1 Profile with
ImageField(custom storage class to host/serve Cloudflare Images) - foreign key
UserConsentmodel for Terms of Use.
poetry, npm, vscode, just, ^3.11 python
# 'just' wraps initial setup into a single command
gh repo clone justmars/start-django dj \
&& cd dj \
&& just start # (1)
- When copy/pasting, just change
djto whatever folder. See to unpack steps in this recipe which includes virtual environment (.venv) setup viapoetry; installation of tailwind withnpmand running the build step withnpx tailwindcss; and initial management commands:collectstatic,compress,makemigrations,migrateandrunserver_plus(fromdjango_extensions).
- Set example file to .env to make it easy to supply env vars.
- This will create
/nodemodules/(.gitignoreed) containing TailwindCSS dependencies. - Invokes
/src/static/css/input.css+./tailwind.config.jsto build/static/css/output.css. See full process - Installs virtual environment in a local
.venv(assumespoetry config --listshowsvirtualenvs.create = trueandvirtualenvs.in-project = true) then createspoetry.lock, ensures a copy of the requirements.txt file is copied into/src - Prepares models declared in
src/pagesand/src/profilesas sql statements found in/migrationsfolder of each app. Since I didn't declare aDATABASE_URLin the environment, this will default to creating an emptysrc/db.sqlite - Sets up tables in default sqlite database (unless a
DATABASE_URLpointing to a local postgres db is set in.env) - Populates
/src/staticfilesdirectory - Creates compressed css / js manifest in
/src/static/CACHE - Django management command to launch django.setup(). No need to setup
.envvalues since default local settings will be used as a quickstart example. Uses django_extention's runserver_plus
Details
After initial setup: