Exemplo n.º 1
0
    def log_request(self, request):
        now = datetime.datetime.utcnow().replace(tzinfo=utc)
        try:
            api = CloudAPI.objects.get(app=request.app, date=now.date())
            api.count += 1
        except CloudAPI.DoesNotExist:
            api = CloudAPI(count=1, app=request.app, date=now.date())

        api.save()
Exemplo n.º 2
0
 def log_request(self, request):
     now = datetime.datetime.utcnow().replace(tzinfo=utc)
     api = CloudAPI(time=now, api=request.path)
     api.save()