New Template Changes
Why??
Hypertext On Whatever you'd Like
HTMX and ajax
Simple HTML api
Swiss-Army knife for ajax
- Now any element, not just anchors and forms, can issue an HTTP request
- Now any event, not just clicks or form submissions, can trigger requests
- Now any HTTP verb, not just GET and POST, can be used
- Now any element, not just the entire window, can be the target for update by the request
Boosting
Automatic Spa-ifys normal links
Like Swup/pjax/turbolinks but works
Preserves animations across swaps
Does a lot:
Javascript Build
Hot Reload
Django template reload powered by vite plugin
Run as a separate process, similar to next.js
Fast!
Typescript
New @ alias
Eslint + prettier checking
Use with Care!
CSS and Styling
Editor plugins
Standard spacing + typography in tailwind.js config
SCSS
That said, Vite does provide built-in support for .scss, .sass, .less, .styl and .stylus
Autoprefix
?????
FontAwesome 5.0
Not married to this one
If we pull this out, lets do it soon as it's extra on the wire
Normal Static files
System Management
Works like pipenv but faster
More collaborators
GoodBye Virtualenv Wrapper
Welcome .venv folder
.envrc file controls behavior - allow shipping activation behavior
Still using .env to control variables
Closer env local to prod
Easier Install
Apt install direnv &&
echo 'eval "$(direnv hook zsh)"' >> .zshrc
Linux
OSX
brew install direnv &&
echo 'eval "$(direnv hook zsh)"' >> .zshrc
Debugging and linting
Configure with environment variable "PYTHONBREAKPOINT"
d = {'key': {1: 'one'}} ic(d['key'][1]) class klass(): attr = 'yep' ic(klass.attr)
Prints
ic| d['key'][1]: 'one' ic| klass.attr: 'yep'
from icecream import ic def foo(): ic() first() if expression: ic() second() else: ic() third()
Prints
ic| example.py:4 in foo() ic| example.py:11 in foo()
Also check out: https://github.com/romanvm/python-web-pdb
Fast Tutorial:
Remember that you configure with breakpoint
Django-Debug-Toolbar
Coming soon
https://github.com/jazzband/django-debug-toolbar/pull/1577
https://github.com/jazzband/django-debug-toolbar/pull/1569
Fixes on git commit attempt
❯ pre-commit run --all-files
Integration Testing
Several Gui tools - Only in node :(
CLI tool
Production Configuration
Render.com
Mix and match Docker and buildpacks as a deploy target
Render.yaml and blueprints
Env groups
Automatic CDN/Cloudflare
Preview Environments
Minio
New Template Changes
By Ben Beecher
New Template Changes
- 590