def handler(fun, *args, **kwargs):
     params = DIALOG_PARAMS.copy()
     if CSRF_TOKEN_REQUIRED:
         state = str(uuid.uuid4())
         params['state'] = state
         session['facebook_state'] = state
     return redirect("{}?{}".format(DIALOG_URL, urllib.urlencode(params)))
 def inner(request, *args, **kwargs):
     fun(request, *args, **kwargs)
     params = DIALOG_PARAMS.copy()
     if CSRF_TOKEN_REQUIRED:
         state = str(uuid.uuid4())
         params['state'] = state
         request.session['facebook_state'] = state
     return HttpResponseRedirect("{}?{}".format(DIALOG_URL, urllib.urlencode(params)))