dropbox integration stuff
This commit is contained in:
13
cookbook/views/api.py
Normal file
13
cookbook/views/api.py
Normal 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)
|
Reference in New Issue
Block a user