0% found this document useful (0 votes)
6 views5 pages

Django 5G Blog Application Setup Guide

The document outlines the steps to create a Blog Application using Django for the backend and React for the frontend. It includes instructions for setting up the project environment, installing necessary dependencies, creating app structures, and running both backend and frontend servers. Key components include user authentication, CRUD operations for blog posts, and linking URLs for the application.

Uploaded by

rakeshraj5186
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Django 5G Blog Application Setup Guide

The document outlines the steps to create a Blog Application using Django for the backend and React for the frontend. It includes instructions for setting up the project environment, installing necessary dependencies, creating app structures, and running both backend and frontend servers. Key components include user authentication, CRUD operations for blog posts, and linking URLs for the application.

Uploaded by

rakeshraj5186
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Rishil Mittal 11232984 5G

Project – Blog Application

Project Overview: This Blog Application is a complete blogging site for the users where
users can add, edit and delete their blogs and share to everyone on the world. It contains all
the features of a Blog site like login/register into the system, CRUD operation like add blog
post with title, description and image and edit or delete the blog post.

1. Start a Django project using these commands in terminal -


# Create virtual environment (backend) -

mkdir blog_project

cd blog_project

python -m venv venv

venv\Scripts\activate # Windows

# Install backend dependencies -

pip install django djangorestframework django-cors-headers

#create app

python [Link] startapp posts

# Run Django server

python [Link] runserver

# (In new terminal) Run frontend –

mkdir blog_frontend

cd blog_frontend

npm install

npm run dev

2. Update [Link] Add REST installed apps and cors config:


Rishil Mittal 11232984 5G

3. blog_project/[Link] Link the app URLs:

4. posts/[Link] -
Rishil Mittal 11232984 5G

5. Create posts/[Link] -

6. posts/[Link]

7. posts/[Link]

8. Run Migrations and Test -


python [Link] makemigrations

python [Link] migrate

python [Link] runserver

9. Set Up React Frontend From root folder

cd ..

npm create vite@latest blog_frontend template react

cd blog_frontend

npm install axios

npm install
Rishil Mittal 11232984 5G

10. blog_frontend/src/services/[Link]

11. blog_frontend/src/components/[Link], [Link] and [Link]


Rishil Mittal 11232984 5G

12. blog_frontend/src/[Link]

13. Run Both Servers

In two terminals:

Terminal 1 (Backend):

cd PYTHONPROJECT/blog_project

venv\Scripts\activate

python [Link] runserver

Terminal 2 (Frontend):

cd PYTHONPROJECT/blog_frontend

npm run dev

Visit [Link]

You might also like