https://github.com/marfullsen/django-spa-cross-origin-auth
Simplest cross origin authentication with Django using Single Page Applications (React/Vue3).
https://github.com/marfullsen/django-spa-cross-origin-auth
auth cookie cross-origin
Last synced: 9 days ago
JSON representation
Simplest cross origin authentication with Django using Single Page Applications (React/Vue3).
- Host: GitHub
- URL: https://github.com/marfullsen/django-spa-cross-origin-auth
- Owner: Marfullsen
- Created: 2022-12-16T13:59:24.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-16T14:49:38.000Z (over 3 years ago)
- Last Synced: 2025-02-27T07:13:41.571Z (over 1 year ago)
- Topics: auth, cookie, cross-origin
- Language: Python
- Homepage:
- Size: 490 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django + SPA (cross origin) Auth
Cookie based authentication, frontend and backend separated, cross origin.
Original Article [here](https://testdriven.io/blog/django-spa-auth/)
## 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:
```sh
$ 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:
```sh
$ cd frontend_react
$ npm install
$ npm start
```
Test at [http://localhost:3000/](http://localhost:3000/).
**or**
Run Vue:
```sh
$ cd frontend_vue
$ npm install
$ npm run dev
```
Test at [http://localhost:5173/](http://localhost:5173/).