A CLI tool to quickly scaffold Django + Inertia.js projects with React or Vue
Project description
Django Inertia Starter
A powerful CLI tool to quickly scaffold Django + Inertia.js projects with React or Vue.js frontends.
๐ Quick Start
Installation
pip install create-django-inertia
Create a New Project
# Basic project creation (interactive prompts)
create-django-inertia myproject
# Create with React and TypeScript
create-django-inertia myproject --react --typescript
# Create with Vue 3 and TypeScript
create-django-inertia myproject --vue --typescript
# Create in current directory
create-django-inertia myproject . --react
Run Your Project
cd myproject
# Backend setup
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
# Frontend setup
npm install
# Run development servers
python manage.py runserver & npm run dev
Visit http://localhost:8000 to see your app!
๐ Project Structure
myproject/
โโโ manage.py
โโโ requirements.txt
โโโ package.json # Frontend dependencies
โโโ vite.config.ts # Vite configuration
โโโ tsconfig.json # TypeScript config (if --typescript)
โโโ .gitignore
โ
โโโ myproject/ # Django project settings
โ โโโ settings.py # Pre-configured with Inertia.js
โ โโโ urls.py
โ โโโ views.py # Inertia.js views
โ โโโ wsgi.py
โ โโโ asgi.py
โ
โโโ home/ # Django app
โ โโโ views.py # Sample Inertia views
โ โโโ urls.py
โ โโโ models.py
โ โโโ migrations/
โ
โโโ templates/
โ โโโ base.html # Inertia.js layout with Vite integration
โ
โโโ static/ # Frontend source files
โ โโโ components/ # Reusable components
โ โโโ pages/ # Inertia.js pages
โ โ โโโ home/
โ โ โโโ page.tsx # Home page component
โ โโโ css/
โ โ โโโ app.css # Tailwind CSS with OKLCH colors
โ โโโ lib/ # Utilities and helpers
โ โโโ main.tsx # Frontend entry point
โ
โโโ media/ # User uploads
โ๏ธ Features
๐๏ธ Full-Stack Integration
- Django Backend: Robust Python web framework with ORM, admin, and security
- Inertia.js: Seamless SPA experience without separate API
- Modern Frontend: React 18 or Vue 3 with Vite 6.0 for fast development
๐จ Frontend Options
- React: Modern React with hooks and TypeScript support
- Vue 3: Composition API with
<script setup>syntax - TypeScript: Full TypeScript support for both frameworks
- Vite 6.0: Latest build tool with improved performance
๐ง Developer Experience
- Hot Module Replacement: Instant updates during development
- Pre-configured: Ready-to-use setup with modern defaults
- Modern Design: Beautiful landing page with OKLCH color system
- Tailwind CSS v4: Latest CSS framework with inline theming
- Geist Fonts: Modern typography from Vercel
๐ฆ Production Ready
- Static Files: Optimized Django static file handling with Vite
- Modern Dependencies: Latest stable versions of all packages
- Build Process: Optimized production builds
- Deployment: Works with any Django hosting solution
๐ ๏ธ Command Options
create-django-inertia
create-django-inertia PROJECT_NAME [DIRECTORY] [OPTIONS]
Arguments:
PROJECT_NAME: Name of your project (required)DIRECTORY: Directory to create project in (optional, defaults to project name or use.for current directory)
Options:
--react: Use React frontend framework--vue: Use Vue 3 frontend framework--typescript: Use TypeScript instead of JavaScript--force: Overwrite existing directory--no-install: Skip installation prompts--help: Show help message
Examples:
# Interactive setup (prompts for framework choice)
create-django-inertia myblog
# React with TypeScript
create-django-inertia myblog --react --typescript
# Vue 3 with TypeScript
create-django-inertia myblog --vue --typescript
# Create in current directory
create-django-inertia myblog . --react
# Force overwrite existing directory
create-django-inertia myblog --react --force
# Skip installation steps
create-django-inertia myblog --vue --no-install
๐โโ๏ธ Development Workflow
1. Create and Setup Project
create-django-inertia myapp --react --typescript
cd myapp
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
npm install
2. Database Setup
python manage.py migrate
python manage.py createsuperuser # Optional: create admin user
3. Development Servers
# Single command (runs both servers)
python manage.py runserver & npm run dev
# Or in separate terminals:
# Terminal 1: Django backend
python manage.py runserver
# Terminal 2: Vite frontend
npm run dev
4. Create New Pages
- Add Django view in
home/views.py:
def about(request):
return inertia_render(request, 'home/about', {
'message': 'About our company'
})
- Add URL route in
home/urls.py:
path('about/', views.about, name='about'),
- Create frontend component in
static/pages/home/about.tsx(React) orstatic/pages/home/about.vue(Vue)
๐ฏ What's Included
Backend (Django)
- โ Django 4.2+ with modern Python features
- โ Inertia.js middleware and configuration
- โ Home app with sample Inertia views
- โ Admin interface ready
- โ Static files configuration for Vite
- โ CSRF protection integrated
- โ Modern Django project structure
Frontend (React/Vue)
- โ React 18 or Vue 3 with modern patterns
- โ TypeScript support (optional)
- โ Vite 6.0 for lightning-fast development
- โ Inertia.js client-side routing
- โ Tailwind CSS v4 with OKLCH colors
- โ Modern landing page with components
- โ Hot module replacement
- โ Geist fonts integration
- โ Production build optimization
๐ Learn More
- Django Documentation
- Inertia.js Documentation
- React Documentation
- Vue 3 Documentation
- Vite Documentation
- TypeScript Documentation
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Django team for the amazing web framework
- Inertia.js team for bridging frontend and backend
- React and Vue teams for excellent frontend frameworks
- Vite team for the blazing fast build tool
Happy coding! ๐
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file create_django_inertia-1.0.2.tar.gz.
File metadata
- Download URL: create_django_inertia-1.0.2.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
973f7f25649299909b9bb1330ee3588f3d496070b5c0f55b5220f40aa2992e61
|
|
| MD5 |
cddf55fc796e662822cc10c5943c2b72
|
|
| BLAKE2b-256 |
85079e25b178afc3b0c0e1acb69548e703a01c7ee690e756596a25119da06a9a
|
File details
Details for the file create_django_inertia-1.0.2-py3-none-any.whl.
File metadata
- Download URL: create_django_inertia-1.0.2-py3-none-any.whl
- Upload date:
- Size: 44.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12a47299beea1d605fbd680f1d4ffa91a1a7547f12cfa36e5242c1b43438027e
|
|
| MD5 |
8c062fc08b0c377d095cb44e068ce7e7
|
|
| BLAKE2b-256 |
14d5798f6461b67e1004477601bd0b96484be35163a2c67db8d110e63fea40ce
|