Did I find the right examples for you? yes no

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/d/j/django-swingers-1.1.1/swingers/sauth/views.py   django-swingers(Download)
        secret = request.REQUEST["access_token"]
        try:
            token = Token.objects.get(secret=secret)
        except Token.DoesNotExist:
            return http.HttpResponseForbidden("Token does not exist")

src/d/j/django-swingers-1.1.1/swingers/middleware/auth.py   django-swingers(Download)
        # if the request is made with a token check auth/magically authenticate
        if access_token is not None and Token.objects.filter(secret=access_token).exists():
            token = Token.objects.get(secret=access_token)
            valid = timezone.now() - timedelta(seconds=token.timeout) < token.modified
            valid = valid or token.timeout == 0

src/d/j/django-swingers-1.1.1/swingers/middleware/tests.py   django-swingers(Download)
            AuthenticationMiddleware().process_request(request), None)
        self.assertEqual(request.user, user)
        token = Token.objects.get(secret='sesame')
        self.assertNotEqual(token.modified, modified)
 
            AuthenticationMiddleware().process_request(request), None)
        self.assertEqual(request.user, user)
        token = Token.objects.get(secret='sesame')
        self.assertNotEqual(token.modified, modified)
 

src/d/j/django-swingers-1.1.1/swingers/sauth/tests.py   django-swingers(Download)
        response = self.client.get(url, data)
        self.assertEqual(response.status_code, 200)
        token = Token.objects.get(secret=response.content)
        self.assertEqual(token.timeout, 100)
 
        }
        response = self.client.get(url, data)
        token = Token.objects.get(pk=token.pk)
        self.assertNotEqual(token.modified, modified)
        self.assertEqual(response.content, "true")