def pic_token(context, image, size): user_id = context['user_id'] user = User.objects.get(id=user_id) token = FindingImageAccessToken(user=user, image=image, size=size) token.save() return reverse('download_finding_pic', args=[token.token])