dropbox integration stuff

This commit is contained in:
vabene1111
2018-02-05 19:57:32 +01:00
parent 6a93e9d28e
commit 35d8d50861
11 changed files with 175 additions and 115 deletions

13
cookbook/views/api.py Normal file
View File

@ -0,0 +1,13 @@
from cookbook.models import Recipe
from cookbook.helper import dropbox
from rest_framework.decorators import api_view
from rest_framework.response import Response
@api_view(['GET'])
def get_file_link(request, recipe_id):
recipe = Recipe.objects.get(id=recipe_id)
response = dropbox.get_share_link(recipe.path)
return Response(response)