from ..models import mail_list_types
from django.http import JsonResponse, Http404


def init_API(request, get_Dict=False):

    # auth_data = request.GET
    # if not check_user_key_inter(auth_data):
    #     raise exceptions.PermissionDenied()

    Dict = {

    }

    mail_list_types_Dict = {}
    for item in mail_list_types:
        mail_list_types_Dict.update({
            item[0] : item[1]
        })
    Dict.update({'mail_list_types' : mail_list_types_Dict})

    if get_Dict:
        return Dict


    return JsonResponse({'data': Dict})