school/decorators.py
def InvalidLoginAttempts(request):
    """
    If user want to brute force attack to Login system
    This method prevent from this attack
    And User ip address block automatic
    :param request:
    :return:
    """
    ip = request.META.get('HTTP_X_FORWARDED_FOR', 'ipsiyoxdu')
    address = request.META.get('HTTP_USER_AGENT', 'unvaniyoxdu')
    try:
        log = AllowedIpAddress.objects.get(ip=ip, address=address)
        log.failed_login +=1
        log.save()
        if log.failed_login == 5:
            log.failed_login -= 5
            log.status = False
            log.save()
        print('%s %s' % ('STATUS','[PERMISSION DENIED]'))
    except:
        print('%s %s' % ('STATUS','[OK]'))

    If user want to brute force attack to Login system
    This method prevent from this attack
    And User ip address block automatic
    :param request:
    :return:
    
If user want to brute force attack to Login system
This method prevent from this attack
And User ip address block automatic
If user want to brute force attack to Login system This method prevent from this attack And User ip address block automatic
def InvalidLoginAttempts(request):
    ip = request.META.get('HTTP_X_FORWARDED_FOR', 'ipsiyoxdu')
    address = request.META.get('HTTP_USER_AGENT', 'unvaniyoxdu')
    try:
        log = AllowedIpAddress.objects.get(ip=ip, address=address)
        log.failed_login +=1
        log.save()
        if log.failed_login == 5:
            log.failed_login -= 5
            log.status = False
            log.save()
        print('%s %s' % ('STATUS','[PERMISSION DENIED]'))
    except:
        print('%s %s' % ('STATUS','[OK]'))
def InvalidLoginAttempts ( request ) : ip = request . META . get ( 'HTTP_X_FORWARDED_FOR' , 'ipsiyoxdu' ) address = request . META . get ( 'HTTP_USER_AGENT' , 'unvaniyoxdu' ) try : log = AllowedIpAddress . objects . get ( ip = ip , address = address ) log . failed_login += 1 log . save ( ) if log . failed_login == 5 : log . failed_login -= 5 log . status = False log . save ( ) print ( '%s %s' % ( 'STATUS' , '[PERMISSION DENIED]' ) ) except : print ( '%s %s' % ( 'STATUS' , '[OK]' ) )
If user want to brute force attack to Login system
This method prevent from this attack
And User ip address block automatic
If user want to brute force attack to Login system This method prevent from this attack And User ip address block automatic
"""
    If user want to brute force attack to Login system
    This method prevent from this attack
    And User ip address block automatic
    :param request:
    :return:
    """
None
request
None