React-admin data and authentication provider for Django REST Framework (DRF). Current stable version is 0.2.1, targeting react-admin 3.x via peer dependency ra-core ^3.5.3. Provides sorting, pagination with PageNumberPagination, filtering (generic and DjangoFilterBackend), and two authentication providers: token-based (TokenAuthentication) and JWT (JSON Web Token Authentication). Compared to generic providers, it directly maps react-admin query parameters to DRF's URL parameters, simplifying integration. Requires Node >=10. Ships TypeScript types.
npm install ra-data-django-rest-frameworkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal setup: import default drfProvider, create data provider with API base URL, and use in react-admin Admin component.
When using authentication, always pass the httpClient as second argument: drfProvider('/api', fetchJsonWithAuthToken).For react-admin 4+, consider using the official ra-data-simple-rest or a raw fetchJson provider.
Ensure your DRF API uses PageNumberPagination or customize pagination class.
Pass URL in options: tokenAuthProvider({obtainAuthTokenUrl: '/custom-auth/'})Run 'npm install ra-data-django-rest-framework' and ensure it's in dependencies.
Use import drfProvider from 'ra-data-django-rest-framework' (default import).
Install ra-core: 'npm install ra-core@^3.5.3'
Login using authProvider before making requests.