Skip to content

LSAB23/storageserver

Repository files navigation

NOT FOR PRODUCTION

AUTHENTICATION

  • send auth request as a post request with to the /auth path with:

    • token : ' the token you have set'
  • when you have already authenticated

    • send every request with the auth sessions token that was used to authenticate

Uploading

  • when uploading a file
    • data_needed
      • name : 'file_name'
      • data : 'file you want to upload' example using python's requests library; requests.post('url', data={'name':'name_of_file'}, files={'data' : open('path_to_file', 'rb')})
      • make sure you have an auth session from authenticating
    • If succesfull the server will return the name given to the file on saveing it.

DELETE

  • when deleting a file
    • name : name of the file you want to delete

Exists

  • When checking if a file exists
    • name : just the name of the in a post request {'name':'name_of_file'}

ENV FILE

  • secret_key : the key to use for authentication
  • addr : a str (eg; 127.0.0.1:8000) for the server or the default will be (127.0.0.1, 8000)

TESTS

  • The tests needs a testuploaddir with
    • testdb.sqlite3 and testfile.txt

Django Compatible

  • lsab directory contains the files neccesary to use it with django

About

A django compatible storage server i created learning about the storage system for django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors