This folder (main/backend/) contains the Django backend for the React + Vite frontend.
- Frontend:
main/frontend/ - Backend:
main/backend/
- Initialized Django project (
config) - Created virtual environment
- Installed necessary packages:
djangodjangorestframeworkdjango-cors-headersdjangorestframework-simplejwt(for JWT-based auth)
- Implemented JWT-based login using cookies
- On successful login:
accessandrefreshtokens are stored in HTTP-only cookies
- Example API endpoint created:
POST /api/login/– authenticates user and sets cookies
- Enabled CORS to allow frontend access:
http://localhost:5173(Vite dev server)
- Allowed credentials to support cookie-based auth
- Created custom user model (based on
AbstractUser) incore/models.py- Ready to extend for future fields
- Navigate to
main/backend/ - Create virtual environment and activate:
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate