Skip to main content

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

image

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.

  1. Vite server
npm run dev
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_breeze-0.2.0.tar.gz (328.3 kB view hashes)

Uploaded Source

Built Distribution

django_breeze-0.2.0-py3-none-any.whl (338.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page