

import requests

try:
    from django.contrib.auth import authenticate, login
    from django.shortcuts import redirect, render
except ImportError:
    lowerCamelCase_    =					lowerCamelCase_    =					lowerCamelCase_    =					lowerCamelCase_    =					print



def    UpperCamelCase(					lowercase_							)	->				Tuple:





  '''simple docstring'''





  snake_case_       						=      """secretKey"""
  snake_case_       						=      """https://www.google.com/recaptcha/api/siteverify"""

  # when method is not POST, direct user to login page
  if request.method != "POST":
    return render(lowercase_			,					"""login.html"""							)

  # from the frontend, get username, password, and client_key
  snake_case_       						=      request.POST.get("""username"""							)
  snake_case_       						=      request.POST.get("""password"""							)
  snake_case_       						=      request.POST.get("""g-recaptcha-response"""							)

  # post recaptcha response to Google's recaptcha api
  snake_case_       						=      requests.post(lowercase_			,					data={"""secret""": secret_key, """response""": client_key}							)
  # if the recaptcha api verified our keys
  if response.json().get("""success"""			,					lowercase_							):
    # authenticate the user
    snake_case_       						=      authenticate(lowercase_			,					username=lowercase_			,					password=lowercase_							)
    if user_in_database:
      login(lowercase_			,					lowercase_							)
      return redirect("""/your-webpage"""							)
  return render(lowercase_			,					"""login.html"""							)


from typing import Callable



def    UpperCamelCase(					lowercase_							)	->				List[str]:





  '''simple docstring'''





  def wrapper(lowercase_							):
    snake_case_       						=      function_with_docstring.__doc__
    return target_function

  return wrapper