This project was made as an assignment for github externship. It is a django server which fetches youtube data and stores it and return to user when requested. It is made using django , rest_framework.
- GET complete list of queries required in tabulated manner.
- Search Videos based on description and title queries.
- Tables are updated every 10 seconds using Threading Technique
Numpy Style followed in docstring.
-
Install any suitable version of python. Also, ensure that pip is also installed along with it.
-
Run following commands in the same directory as manage.py
pip install < requirements.txt
python manage.py makemigrations
python manage.py migrate
-
Rename .env.sample to .env
-
Set the parameters query in the query.py file which is inside the api Directory
- query - Any Query which is to be searched.
- Run the django server using
python manage.py runserver
It runs the backend server at default port 8000. As well schedules a job on a different thread to fetch youtube videos and store it in the database after specific intervals. Open http://localhost:8000 to view it in the browser.
This API has two basic functionalities :
-
View List of Videos in paginated format: Send a GET Request to url: http://localhost:8000/api/videolist/ without any params.
-
Search for Videos based on a specific query
Send a GET Request to url : http://localhost:8000/api/search/ with no params but body(in JSON format) as follows :
To search using Title
{
"title" : "Your_title_here"
}
To search using description
{
"description" : "Your_description_here"
}