0% found this document useful (0 votes)
55 views

Django React Setup

The document discusses setting up a Django project with React by creating a virtual environment, installing dependencies like Django and Django REST Framework, creating a Django project and app, adding the app to settings, and creating models and serializers to interface between the backend and frontend. It provides instructions for configuring the Python interpreter in VSCode and the basic steps to set up the backend and connect it to a frontend framework like React.

Uploaded by

test user
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Django React Setup

The document discusses setting up a Django project with React by creating a virtual environment, installing dependencies like Django and Django REST Framework, creating a Django project and app, adding the app to settings, and creating models and serializers to interface between the backend and frontend. It provides instructions for configuring the Python interpreter in VSCode and the basic steps to set up the backend and connect it to a frontend framework like React.

Uploaded by

test user
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Django and react

- Create a virtual environment using pipenv shell command inside the directory you are
working.

The result will look something like the above image. There will be a pip file inside the
project folder once you create a virtual environment.
- Install the following dependencies that are necessary for the project namely Django,
djangorestframework and Django-rest-knox.

- Create a Django project with django-admin startproject theNameOfTheProject


- Make sure you select the right interpreter on vscode using cmd+shift+p and entering
python will bring select interpreter. Click on it and you will find:

Choose this option, since it has a relation with the project you are working with.

- Then create a Django app using python3 manage.py startapp app_name

- Then add your app inside the settings.py file in the inner ecommerce directory.
- Add rest_framework to the installed_apps list in the above image, since we are also
going to use that.

After the setup,


- Create a model for the app in Django model.py file.

Serializers (we use the Django-rest-api serializers)


- Are used to convert python objects into a datatype that can be understood by frontend
languages like JavaScript and frontend frameworks.

You might also like