Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.330s · 69.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.9s · import 1.178s · 70MB
69MB installed
● package 69MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
InertiaMiddleware
✓ from inertia.middleware import InertiaMiddleware
✗ from inertia.middleware import inertia_middleware
Class name is camelcase, not snakecase
render_inertia
✓ from inertia import render_inertia
share
✓ from inertia import share
Minimal view returning Inertia response
from inertia import render_inertia
from django.views import View
class HomeView(View):
def get(self, request):
return render_inertia(request, 'Home', {'user': {'name': 'John'}})
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'inertia'
Package not installed or imported using old name (`django-inertia`).
fixInstall `inertia-django` and import as `from inertia import ...`
TemplateDoesNotExist at /
Inertia view returned a template response instead of Inertia response because `render_inertia` was not used.
fixUse `render_inertia(request, component_name, props)` instead of `render(request, template)`
CSRF Failed: CSRF token missing or incorrect.
The Inertia frontend did not send the CSRF token in the `X-CSRFToken` header.
fixEnsure your frontend reads the CSRF token from the cookie and sets the header on every request.
Upgrade
Version history
1.2.0latest on PyPI · released Mar 25, 2025
Audit
Dependencies
djangorequiredCore framework dependency
inertia-corerequiredServer-side Inertia protocol handling