Skip to content
Snippets Groups Projects
Commit d711b5c1 authored by borzechof99's avatar borzechof99 :whale2:
Browse files

Connect react-admin to Django Backend

parent 5d7be50a
No related branches found
No related tags found
No related merge requests found
......@@ -6867,6 +6867,11 @@
"to-regex-range": "^5.0.1"
}
},
"filter-obj": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz",
"integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs="
},
"final-form": {
"version": "4.20.2",
"resolved": "https://registry.npmjs.org/final-form/-/final-form-4.20.2.tgz",
......@@ -12798,6 +12803,32 @@
}
}
},
"ra-data-django-rest-framework": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/ra-data-django-rest-framework/-/ra-data-django-rest-framework-0.2.0.tgz",
"integrity": "sha512-1ku0P9wFSIrPSacYVLw5emJOoYS71VkXt+asdu7rO7y0H7Hx6VvKfmZj07sQbLwctkjB5yatSPr9W6X7nz2K8A==",
"requires": {
"query-string": "^6.12.1"
},
"dependencies": {
"query-string": {
"version": "6.14.1",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz",
"integrity": "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==",
"requires": {
"decode-uri-component": "^0.2.0",
"filter-obj": "^1.1.0",
"split-on-first": "^1.0.0",
"strict-uri-encode": "^2.0.0"
}
},
"strict-uri-encode": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
"integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY="
}
}
},
"ra-data-json-server": {
"version": "3.16.2",
"resolved": "https://registry.npmjs.org/ra-data-json-server/-/ra-data-json-server-3.16.2.tgz",
......@@ -14795,6 +14826,11 @@
"wbuf": "^1.7.3"
}
},
"split-on-first": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
"integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw=="
},
"split-string": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
......
......@@ -7,6 +7,7 @@
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"bootstrap": "^5.0.1",
"ra-data-django-rest-framework": "^0.2.0",
"ra-data-json-server": "^3.16.2",
"react": "^17.0.2",
"react-admin": "^3.16.2",
......
......@@ -3,12 +3,15 @@ import { Admin, Resource, ListGuesser } from 'react-admin';
import './App.css';
import dashboard from './dashboard';
import jsonServerProvider from 'ra-data-json-server';
import drfProvider from 'ra-data-django-rest-framework';
const dataProvider = jsonServerProvider('http://localhost:8000/api/admin')
// const dataProvider = jsonServerProvider('http://localhost:8000/api/admin')
const dataProvider = drfProvider('http://localhost:8000/api/admin');
const App = () => (
<Admin dataProvider={dataProvider}>
<Resource name='sport-list' list={ListGuesser} />
<Resource name='criterion-list' list={ListGuesser} />
</Admin>
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment