This project demonstrates how to implement user authentication in Django with communication to frontend technologies like React using JSON Web Tokens (JWT).
git clone https://github.com/sinasezza/django-react-jwt.git
cd django-react-jwtMake sure you have Python and Node.js installed on your system.
Install pipenv if you haven't already:
pip install pipenvSet up the Python environment and install Python dependencies:
pipenv shell
pipenv installTo install or update frontend dependencies, use the provided management command:
Install dependencies:
pipenv run python manage.py npm installUpdate dependencies:
pipenv run python manage.py npm updateTo run the frontend server for development:
pipenv run python manage.py npm startTo build the frontend for production:
pipenv run python manage.py npm buildTo serve the production build of the frontend:
pipenv run python manage.py npm serveApply migrations:
pipenv run python manage.py makemigrations
pipenv run python manage.py migrateRun the Django development server:
pipenv run python manage.py runserver