A Django boilerplate made with Modernity in mind.
Django 4.0.x
- a web framework written in Python; you also will write apps in Python.Tailwind.css
- a CSS utility framework that allows frontend customizations with HTML classes; and builds what-you-only-need on production.htmx
- a supercharger for websites that came in HTML utility tags, make AJAX requests, capture many events and replace HTML content without actually writing JS.Python >= 3.8
Node.js >= 16 + npm
Postgres Server + Client Library ~= 14
see docs for more infopsycopg2
for productiongcc
or any C compilerPython headers
usually in python3-dev
packagelibpq-dev
To setup this boilerplate with the most stable version, head to the Releases tab and get the latest one.
.env
file to store enviroment variables. Please refer to .env.example
npm
for NPM_BIN_PATH
!python3 -m venv .venv
# or on Windows...
python -m venv .venv
pip install -r requirements.txt
# or if you're installing for production...
pip install -r requirements/prod.txt
./theme/static_src/
.npm install
python3 ./manage.py tailwind start # runs Tailwind.css server
python3 ./manage.py runserver # runs Django server
After completing the setup you can consult the materials to get started on developing a supercharged Django app!
Added in Revision 3
Type checking is a powerful tool for developers to know what they're doing. In Django, types are pretty much
generic especially, RelatedManager
, ForeignKey
etc.
To solve the problem of most type checker not being able to understand Django's typing, we must use an extension to the source code, "stubs."
This boilerplate uses django-types
package from PyPI as stubs and it needs some workarounds to work properly.
Consult the Github Repository for more info.
Don’t keep "trying" solutions until you find one that works. Take the time to find the correct solution. -- Steve Maguire
There are also materials for specific Python packages for app dependencies,
django.contrib.postgres
, set LOCAL_DB
to "False"