from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from datetime import datetime
# from .models import TemporaryFiles
from vidwik.settings import BASE_URL

class FileUploadView(APIView):
    def post(self, request, *args, **kwargs):
      file = TemporaryFiles.objects.create(
          temp_file=request.data['media'],
          created_at=datetime.utcnow()
      )
      return Response({"media_url":BASE_URL+file.temp_file.url[1:]},status=status.HTTP_201_CREATED)
aba1760ae85089bb83d7c0eb4f885ebcba721c86
<mask token>

<mask token>


class FileUploadView(APIView):
    <mask token>

<mask token>


class FileUploadView(APIView):

    def post(self, request, *args, **kwargs):
        file = TemporaryFiles.objects.create(temp_file=request.data['media'
            ], created_at=datetime.utcnow())
        return Response({'media_url': BASE_URL + file.temp_file.url[1:]},
            status=status.HTTP_201_CREATED)

from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from datetime import datetime
from vidwik.settings import BASE_URL


class FileUploadView(APIView):

    def post(self, request, *args, **kwargs):
        file = TemporaryFiles.objects.create(temp_file=request.data['media'
            ], created_at=datetime.utcnow())
        return Response({'media_url': BASE_URL + file.temp_file.url[1:]},
            status=status.HTTP_201_CREATED)

from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from datetime import datetime
# from .models import TemporaryFiles
from vidwik.settings import BASE_URL

class FileUploadView(APIView):
    def post(self, request, *args, **kwargs):
      file = TemporaryFiles.objects.create(
          temp_file=request.data['media'],
          created_at=datetime.utcnow()
      )
      return Response({"media_url":BASE_URL+file.temp_file.url[1:]},status=status.HTTP_201_CREATED)