Skip to content

Building Blog App Api with Django and Django Rest Framework

Notifications You must be signed in to change notification settings

trungnhann/blog-app-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog App

How to Run Backend

Prerequisites

  • Ensure you have Python installed on your machine. If not, you can download it from here.
  • Please ensure that the frontend server is already running. Follow the instructions in the frontend repository: blog-app-frontend.

Clone Repository

First, clone the backend repository by running the following command in your terminal:

git clone https://github.com/trungnhanforwork/blog-app-api.git

Navigate to Backend Directory

Next, navigate into the backend directory using the following command:

cd blog-app-api

Create and Activate Virtual Environment

Create a virtual environment using the following command:

python -m venv menv

This command will create a directory named menv containing the virtual environment in the blog-app-api directory.

Activate the virtual environment using the following command:

menv\Scripts\activate

Install Dependencies

Once the virtual environment is activated, install the required packages by running:

pip install -r requirements.txt

Navigate to project directory

Next, navigate into the project directory using the following command:

cd blogproject

Migrate Database

Migrate the database by running the following command:

python manage.py makemigrations
python manage.py migrate

Create Superuser

Create a superuser by running the following command and following the prompts:

python manage.py createsuperuser

Run the Project

Finally, to run the backend server, execute the following command:

python manage.py runserver

About

Building Blog App Api with Django and Django Rest Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages