This document provides the steps to set up and run the Django backend.
python -m pip install --upgrade pip
Open a terminal and navigate to the project directory. Run the following command to install all required packages listed in requirements.txt
:
pip install -r requirements.txt
Change directory to the app
folder:
cd app
Start the Django development server by running the following command:
python manage.py runserver
http://127.0.0.1:8000/
(or a different port if specified).Ensure that you use the correct endpoints as defined in your Django project.
URL:
POST /posts
Function:
createPosts
Description:
Parameters:
Parameter | Type | Description |
---|---|---|
title | string | Title of the post |
content | string | Content of the post |
author | string | Author of the post |
date | string | Date of the post (optional) |
Request Body Example:
{
"title": "Sample Post",
"content": "This is the content of the post.",
"author": "John Doe",
"date": "2024-06-26"
}
Additional Instructions:
Before using the /posts
endpoint, ensure:
facebook_controller.py
file for authentication.Returns: