
    ]9iI                     &    d Z ddlmZ ddlmZ d Zy)z
Initialize custom admin with reCAPTCHA v3 protection.
This module should be imported in apps.py to set up the admin site before any requests.
    )admin)"RecaptchaV3AdminAuthenticationFormc                      t         t        j                  _        t        j                  j                  fd} | t        j                  _        y)zQ
    Configure the default Django admin site to use reCAPTCHA v3 login form.
    c                 B     |       }ddl m} |j                  |d<   |S )Nr   )settingsrecaptcha_public_key)django.confr   RECAPTCHA_PUBLIC_KEY)requestcontextr   original_each_contexts      (/var/www/apihucms/apihucms/admin_init.pyeach_context_with_recaptchaz:setup_recaptcha_admin.<locals>.each_context_with_recaptcha   s&    '0(*2*G*G&'    N)r   r   site
login_formeach_context)r   r   s    @r   setup_recaptcha_adminr   	   s6     ?EJJ "JJ33 :EJJr   N)__doc__django.contribr   apihucms.admin_formsr   r    r   r   <module>r      s    ! C:r   