Skip to content

Latest commit

 

History

History
91 lines (77 loc) · 2.94 KB

File metadata and controls

91 lines (77 loc) · 2.94 KB

corsheader

Cross-Origin Resource Sharing headers, or CORS headers, are an important feature of HTTP that ensures a webpage only uses content permitted by other websites/servers. Django-CORS-header Adding CORS headers allows your resources to be accessed on other domains.

image image image image

Prerequisites

Make sure you have the following software installed on your machine:

  • Python: Download and install the latest version from Python.org.
  • pip: This is the package installer for Python, typically included with Python installation.
  • Virtualenv: This helps create isolated Python environments. You can install it using pip if not - already installed:
pip install virtualenv

Clone the repository

First, clone the repository to your local machine using Git. Open your terminal and run the following command:

https://github.com/sneha-at-hub/Userauthentication-SimpleJWT-RestFramework-react.git

Navigate to the project directory

Change your working directory to the project's directory

cd backend

Create and Activate virtual Environment

virtualenv venv

Activate

On mac/Linux

source venv/bin/activate

On Windows

venv\Scripts\activate

Install Dependencies

Install the project dependencies listed in the requirements.txt file:

pip install -r requirements.txt

Install Django using pip within your virtual environment:

pip install django

Install Django REST Framework using pip:

pip install djangorestframework

Set up the Database

Run the following commands to set up the database:

python manage.py makemigrations
python manage.py migrate

Create a Superuser

Create a superuser to access the Django admin interface:

python manage.py createsuperuser

Run the Development Server

Start the development server:

python manage.py runserver

The development server will typically be available at http://127.0.0.1:8000.

Troubleshooting

Common Issues

  • If you encounter an error like pip: command not found, ensure Python and pip are properly installed.
  • If you see dependency errors, try deleting the venv folder and re-create the virtual environment, then re-run pip install -r requirements.txt.

Useful Links: