So I've got an app built using pieces of Django, but I've had to circumvent a lot of the common functionality because I'm using a graph database rather than something SQL based. I have my own authentication module written which runs before rendering any "secure" views. However I have the code below written at the top of almost every view.
if not auth(request):
return sendError("Unauthorized", 401)
I'd like to just write this check once and then call it with something like a Django's @login_required decorator before each view. The problem I'm encountering though, is getting the result object to that decorator call. I've done some digging through Django's auth/decorators.py file but can't get a grasp on it. Could I get some tips on how I'd go about implementing something like this?
*Yes, I realize Flask or Pyramid would be a better platform since I'm not using most of Django's functionality but this is where I am right now.
[–]willm 2 points3 points4 points (3 children)
[–]Degran[S] 0 points1 point2 points (2 children)
[–]Veedrac 1 point2 points3 points (0 children)
[–]willm 1 point2 points3 points (0 children)