#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# Date: 2018/11/20

from django.middleware.csrf import get_token
from utils.base import APIView
from gm_upload.utils.qiniu_tool import QiniuTool

qiniu_video = {
    'domain': 'video-static.igengmei.com',
    'bucket': 'video',
}


class QiniuToken(APIView):

    def get(self, request):
        token = QiniuTool.get_token(qiniu_video['bucket'])
        return {
            'token': token
        }