Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FunnyWebsiteView(View):
- def get(self, request):
- counter = Counter.objects.get(website_name='Funny')
- counter.views += 1
- counter.save()
- result = 'There were {} visits'.format(counter.views)
- return HttpResponse(result)
Advertisement
Add Comment
Please, Sign In to add comment