You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I am a beginner in django and i need to build an app which enter some user data and their activity period by creating model i can do that to store in sql database.
The problem is i need to display that data in json format any help will be really appreciated
Thanks
HJ
unread,
May 30, 2020, 10:07:39 AM5/30/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
you have to do a Queryset inside your view function , something like :
@login_required
def Home(request):
return render(request,'home.html',{})
@login_required
def JsonFunction(request):
dataset = YourModel.objects.all()
data =list(dataset)
return JsonResponse(data, safe=False)
that's only an example you need to set what you want to show