Marfullsen / django-spa-cross-origin-auth

Simplest cross origin authentication with Django using Single Page Applications (React/Vue3).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django + SPA (cross origin) Auth

Cookie based authentication, frontend and backend separated, cross origin.

Original Article here

Logged Vue

Updated

  • Bug with obsolete component solved using --openssl-legacy-provider
  • Clon written with Vue3 added.

Getting Started

Open a console for the frontend and another one for the backend. Keep both active to run the project.

Run Django:

$ cd backend
$ python -m venv venv && source venv/bin/activate
(venv)$ pip install -r requirements.txt
(venv)$ python manage.py migrate
(venv)$ python manage.py runserver

Choose between React or Vue for the frontend.

Run React:

$ cd frontend_react
$ npm install
$ npm start

Test at http://localhost:3000/.

or

Run Vue:

$ cd frontend_vue
$ npm install
$ npm run dev

Test at http://localhost:5173/.

About

Simplest cross origin authentication with Django using Single Page Applications (React/Vue3).


Languages

Language:Python 35.1%Language:Vue 23.4%Language:JavaScript 22.0%Language:HTML 11.0%Language:CSS 8.4%