{"id":23885,"library":"inertia-django","title":"Inertia Django","description":"Django adapter for the Inertia.js framework to build single-page-app-like experiences without an API. Current version 1.2.0, supports Python >=3.8 <4.0, release cadence is irregular.","status":"active","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/inertiajs/inertia-django","tags":["inertia","django","spa","ssr"],"install":[{"cmd":"pip install inertia-django","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core framework dependency","package":"django","optional":false},{"reason":"Server-side Inertia protocol handling","package":"inertia-core","optional":false}],"imports":[{"note":"Class name is camelcase, not snakecase","wrong":"from inertia.middleware import inertia_middleware","symbol":"InertiaMiddleware","correct":"from inertia.middleware import InertiaMiddleware"},{"note":null,"wrong":null,"symbol":"render_inertia","correct":"from inertia import render_inertia"},{"note":null,"wrong":null,"symbol":"share","correct":"from inertia import share"}],"quickstart":{"code":"from inertia import render_inertia\nfrom django.views import View\nclass HomeView(View):\n    def get(self, request):\n        return render_inertia(request, 'Home', {'user': {'name': 'John'}})","lang":"python","description":"Minimal view returning Inertia response"},"warnings":[{"fix":"Update imports: `from inertia import ...`","message":"In version 1.0 the package was renamed from `django-inertia` to `inertia-django` and the internal module structure changed. All imports from `inertia` must be updated.","severity":"breaking","affected_versions":"<1.0"},{"fix":"Ensure `django.middleware.csrf.CsrfViewMiddleware` is enabled and your frontend sends the header.","message":"CSRF token handling: Inertia expects the CSRF token to be sent via the `X-CSRFToken` header, not the cookie alone. Missing middleware configuration will cause 403 errors.","severity":"gotcha","affected_versions":">=0.3"},{"fix":"Replace `from inertia.contrib import ...` with `from inertia import ...`","message":"The `inertia.contrib` submodule is deprecated and will be removed in a future release. Use the core `inertia` module directly.","severity":"deprecated","affected_versions":">=1.1"}],"env_vars":null,"search_vec":"'1.2.0':22 '3.8':25 '4.0':26 'adapt':4 'api':19 'app':14 'build':10 'cadenc':28 'current':20 'django':2,3,32 'experi':16 'framework':8 'inertia':1,31 'inertia.js':7 'irregular':30 'like':15 'page':13 'python':24 'releas':27 'singl':12 'single-page-app-lik':11 'spa':33 'ssr':34 'support':23 'version':21 'without':17","created_at":"2026-05-01T08:10:08.598567+00:00","updated_at":"2026-05-01T08:10:08.598567+00:00","problems":[{"fix":"Install `inertia-django` and import as `from inertia import ...`","cause":"Package not installed or imported using old name (`django-inertia`).","error":"ModuleNotFoundError: No module named 'inertia'"},{"fix":"Use `render_inertia(request, component_name, props)` instead of `render(request, template)`","cause":"Inertia view returned a template response instead of Inertia response because `render_inertia` was not used.","error":"TemplateDoesNotExist at /"},{"fix":"Ensure your frontend reads the CSRF token from the cookie and sets the header on every request.","cause":"The Inertia frontend did not send the CSRF token in the `X-CSRFToken` header.","error":"CSRF Failed: CSRF token missing or incorrect."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.2.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://inertiajs.com","github":"https://github.com/inertiajs/inertia-django","docs":null,"changelog":null,"pypi":"https://pypi.org/project/inertia-django/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}