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.
Project description
Django Breeze
Introduction
Django Breeze provides a minimal and simple starting point for building a Django application with Inertia
and Vite.js
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',
#...............
]
Generate Project Files
Generate your frontend project files with django-breeze
React
django-breeze react
# or with typescript
django-breeze react --typescript
Vue 3
django-breeze vue3
# or with typescript
django-breeze vue3 --typescript
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!
Usage
For usage, refer to inertia-django for in-depth guidlines.
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, # vite dev mode, default based on django DEBUG
"SERVER_PROTOCOL": "http",
"DEV_SERVER_HOST": "localhost",
"DEV_SERVER_PORT": 5173,
"WS_CLIENT_URL": "@vite/client",
"ASSETS_PATH": "static/dist", # vite build asset path
"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.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d7224c320ed4df3777a76b30042968872451716d4d80d8cd2403df088cc2236 |
|
MD5 | 023c84e04d8332c4a7b561d7357956b6 |
|
BLAKE2b-256 | 295f9e9fb8f6a39102a318458f91b77144b6b2721c63804405a91e06995f868b |