Giter Site home page Giter Site logo

fampay-externship's Introduction

Fampay Backend Assignment

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.

License

MIT

Installation

  • Make a virtual environment using virtualenv. You can install virtualenv using package manager.
  virtualenv venv
  • Activat the virtualenv
source venv/bin/activate 
  • Go inside the directory. cd videolog
  • Install the required packages.
pip install -r requirements.txt
  • Rename .env.sample to .env.
  • Add the required fields. Multiple developer keys can be added by seperating them with a ,
  • You can use [https://djecrety.ir/] to generate your secret key
  • After the above setup run.
python manage.py migrate
  • 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.

Demo

Go to http://localhost:8000/videodata.
You will see list of records sorted in descinding order.
API View
It is a template of rest framework.
Click on filters. You will see a dialog which you can use to search or sort the data.
The api is cursor based paginated.
Dialog Box \

API Reference

Get videos

  GET /videodata/
Parameter Type Description
cursor string Cursor for pagination
ordering string For sorting the data.
search string For searching the data.

srdering the following values

  • published
  • title
  • channel_name Add - infront of it to make it descinding.

search works on the following fields.

  • title
  • description
  • video_id

Possible Improvements

Currently the server uses in memory caching. Considering the scope of the project it is fine. But we can shift to something like redis. Only the cache settings needs to be changed inside the settings.py file.

fampay-externship's People

Contributors

ramyak-mehra avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.