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-jwt
Make sure you have Python and Node.js installed on your system.
Install pipenv if you haven't already:
pip install pipenv
Set up the Python environment and install Python dependencies:
pipenv shell
pipenv install
To install or update frontend dependencies, use the provided management command:
Install dependencies:
pipenv run python manage.py npm install
Update dependencies:
pipenv run python manage.py npm update
To run the frontend server for development:
pipenv run python manage.py npm start
To build the frontend for production:
pipenv run python manage.py npm build
To serve the production build of the frontend:
pipenv run python manage.py npm serve
Apply migrations:
pipenv run python manage.py makemigrations
pipenv run python manage.py migrate
Run the Django development server:
pipenv run python manage.py runserver