Django Breeze provides a minimal and simple starting point for building a Django application with Inertia.js Styled with Tailwind CSS.
Project description
Django Breeze
Introduction
Django Breeze provides a minimal and simple starting point for building a Django application with Inertia
and Vite
with minimal or no configuration. Styled with Tailwind CSS.
Inertia helps build single-page apps, without building an API. Create modern single-page React, Vue, and Svelte apps using classic server-side routing. Works with any backend. Documentation for Inertia can be found on the Intertia website.
Installation
Install the following python package via pip
pip install django-breeze
Add the following apps to your INSTALLED_APPS
in settings.py
INSTALLED_APPS = [
# installed apps,
'django_breeze',
'django_vite',
'inertia',
#...............
]
Generate Project Files
Generate your frontend project files with django-breeze
React
django-breeze react
Vue 3
django-breeze vue3
Install node packages
Run this command to install packages for the frontend.
npm install
# or
yarn
Start Servers
Run the following commands to start your development servers.
Vite server
npm run dev
Django server
python manage.py runserver
Now you're all set!
Configurations
Although, djang breeze comes with minimal or no configurations but here are some of the default settings it comes with out of the box.
Django Settings
# settings.py
DJANGO_BREEZE = {
"INERTIA": {
"LAYOUT": "index.html",
"SSR_URL": "http://localhost:13714",
"SSR_ENABLED": False,
},
"DJANGO_VITE": {
"DEV_MODE": True,
"SERVER_PROTOCOL": "http",
"DEV_SERVER_HOST": "localhost",
"DEV_SERVER_PORT": 5173,
"WS_CLIENT_URL": "@vite/client",
"ASSETS_PATH": "static/dist",
"STATIC_URL_PREFIX": "",
}
Settings for Inertia Django is under INERTIA
and Django Vite is DJANGO_VITE
. You can find more explaination of the settings on their repos
Note:
All settings are joined with underscore to match how their developers defined them e.g inertia settings is INERTIA_LAYOUT
and django vite is DJANGO_VITE_DEV_MODE
which has been done automatically by django breeze so you just use the DJANGO_BREEZE
settings format in your settings.py
file.
Thank you
A very big thanks to Inertia.js Team for Inertia Django Adaptor, and MrBin99 for Django Vite.
License
Laravel Breeze is open-sourced software licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_breeze-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8785e2b421a5a0458df60aa7dbf8e62f9d04ae01d5d456d49b57f6154895e220 |
|
MD5 | d535468265888e9e890a05dc116359de |
|
BLAKE2b-256 | 12603cab446a995c0dc608d739e1add27975a514861a2e48aec2b333ee757d91 |