Example of using Django Ninja with React, including the use of both bearer token and session authentication.
- Python
- Node.js
Create a virtual environment and install the dependencies from requirements.txt
.
e.g.,
python3 -m venv .venv
source .venv/bin/activate
or use your IDE.
Now build the frontend Javascript
cd ./ninjareact/frontend
npm install
npm run build
Now set up the service
cd ..
python manage.py migrate
python manage.py collectstatic --noinput
python createsuperuser
Now run the server
python manage.py runserver
and hit
for API docs, hit