stuff working

This commit is contained in:
vabene1111
2018-02-05 21:12:29 +01:00
parent df576a20ba
commit eea37b9af5
10 changed files with 317 additions and 135 deletions

View File

@ -1,13 +1,11 @@
from django.http import HttpResponse
import json
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)
return HttpResponse(response['url'])