Skip to content

Inertia allows you to create fully client-side rendered, single-page apps, without the complexity that comes with modern SPAs. It does this by leveraging existing server-side patterns that you already love.

Notifications You must be signed in to change notification settings

willianantunes/inertia-django-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inertia Django Playground

This project demonstrates how to effectively integrate Django, Vite, React, Whitenoise, and Inertia.js. It serves as a practical example for developers looking to build a full-stack application using these technologies.

Key features and examples include:

  • CRUD Operations: Discover how to implement create, read, update, and delete (CRUD) operations for the Todo and CreditCard models.
  • Form Handling: Learn how to handle Inertia.js forms using Django's powerful form validation and processing capabilities.

Accessing and running the project

When the server is up, you can access it using the credentials [email protected]:admin at:

Admin panel:

With Docker

Execute the following command in the terminal:

docker compose run --service-ports --rm app-production

Without Docker

Execute the following commands in the terminal:

npm install
npm run dev
docker compose run --service-ports --rm remote-interpreter

Creating the project from scratch from the template

You'll have to answer copier prompts. Check how I answered them looking at the file .copier-answers.yml.

docker run -it --rm --volume $(pwd):/app --workdir /app python:3.12-slim bash
apt update && apt install -y git
pip install pipx
pipx run copier copy gh:sarthakjariwala/django-vite-inertia inertia-django-playground

Recurring commands

Update dependencies:

docker compose run --rm remote-interpreter poetry update

Use bash in the container:

docker compose run --rm remote-interpreter bash

Erase all data and seed the database with 100,000 entries per user:

docker compose run --rm remote-interpreter python manage.py seed \
--erase-data --create-super-user \
--entries-per-user 100000 \
--bulk-batch-size 10000

Only erase all data:

docker compose run --rm remote-interpreter python manage.py seed --erase-data

About

Inertia allows you to create fully client-side rendered, single-page apps, without the complexity that comes with modern SPAs. It does this by leveraging existing server-side patterns that you already love.

Topics

Resources

Stars

Watchers

Forks