from django.shortcuts import render
from django.http import JsonResponse
# Create your views here.
def index(request):
return render(request,'file_upload/index.html')
def send_json(request):
# data = {'id': 4, 'name': 'Test Response','roles' : ['Admin','User']}
data = [
{'id':'101', 'first_name':'Ram','last_name':'Pukar'},
{'id':'102', 'first_name':'Mukesh','last_name':'Thapa'},
{'id':'103', 'first_name':'Anil','last_name':'Shah','email_id':['anil@hotmail.com','anil_info@hotmail.com','anil_test@hotmail.com']},
{'id':'104', 'first_name':'Dinesh','last_name':'Yadav'},
{'id':'105', 'first_name':'Hira','last_name':'Shakya'}
]
return JsonResponse(data,safe=False)
Output:
0 comments:
Post a Comment