Skip to content

romanovsavelij/StingrayPhotos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stringray Photos

Stingray Photos is an api service, written on Django. It is used for uploading pictures in app for TV platform called Stingray.

Install

Use the package manager pip3 to install. Python version should be at least 3.8.

$ pip3 install -r requirements.txt

Run

$ python3 manage.py runserver 0:8000

Run the tests

$ python3 manage.py test

Methods

GetKey

Returns random code

  • URL

    /get_key

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content: { key : "8537" }

Sign in

Sign in with code, given by app

  • URL

    /

  • Method:

    GET

  • Success Response:

    • Code: 200
      Content: image

Upload menu

View and select files to upload

  • URL

    /upload/:key

  • Method:

    GET

  • URL Params

    Required:

    key=[integer]

  • Success Response:

    • Code: 200
      Content: image

Upload files

Upload selected files

  • URL

    /upload/:key

  • Method:

    POST

  • URL Params

    Required:

    key=[integer]

  • Success Response:

    • Code: 200
  • Error Response:

    • Code: 400 Bad Request
      Content: Expected key in request

    • Code: 422 UNPROCESSABLE_ENTITY
      Content: Uploading file size limit exceeded. Try to compress your image

Upload files (Other HTTP methods)

Upload selected files

  • URL

    /upload/

  • Method:

    PUT | DELETE

  • Error Response:

    • Code: 405 METHOD_NOT_ALLOWED
      Content: GET or POST request expected

Get image

Get uploaded images by your code. Returns one of the uploaded images. If multiple images where uploaded, they will be returned following round-robin strategy.

  • URL

    /get_image/:key

  • Method:

    GET

  • URL Params

    Required:

    key=[integer]

  • Success Response:

    • Code: 200
      Content: Image

    If there are no images, default image will be returned: image

  • Error Response:

    • Code: 400 Bad Request
      Content: Expected key in request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published