<s> class AppSettings ( object ) : <EOL> class AuthenticationMethod : <EOL> USERNAME = '<STR_LIT:username>' <EOL> EMAIL = '<STR_LIT:email>' <EOL> USERNAME_EMAIL = '<STR_LIT>' <EOL> class EmailVerificationMethod : <EOL> MANDATORY = '<STR_LIT>' <EOL> OPTIONAL = '<STR_LIT>' <EOL> NONE = '<STR_LIT:none>' <EOL> def __init__ ( self , prefix ) : <EOL> self . prefix = prefix <EOL> assert ( not self . AUTHENTICATION_METHOD == <EOL> self . AuthenticationMethod . EMAIL ) or self . EMAIL_REQUIRED <EOL> assert ( self . AUTHENTICATION_METHOD == <EOL> self . AuthenticationMethod . USERNAME ) or self . UNIQUE_EMAIL <EOL> assert ( self . EMAIL_VERIFICATION != <EOL> self . EmailVerificationMethod . MANDATORY ) or self . EMAIL_REQUIRED <EOL> if not self . USER_MODEL_USERNAME_FIELD : <EOL> assert not self . USERNAME_REQUIRED <EOL> assert self . AUTHENTICATION_METHOD not in ( self . AuthenticationMethod . USERNAME , <EOL> self . AuthenticationMethod . USERNAME_EMAIL ) <EOL> def _setting ( self , name , dflt ) : <EOL> from django . conf import settings <EOL> getter = getattr ( settings , <EOL> '<STR_LIT>' , <EOL> lambda name , dflt : getattr ( settings , name , dflt ) ) <EOL> return getter ( self . prefix + name , dflt ) <EOL> @ property <EOL> def DEFAULT_HTTP_PROTOCOL ( self ) : <EOL> return self . _setting ( "<STR_LIT>" , "<STR_LIT:http>" ) . lower ( ) <EOL> @ property <EOL> def EMAIL_CONFIRMATION_EXPIRE_DAYS ( self ) : <EOL> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> return self . _setting ( "<STR_LIT>" , <EOL> getattr ( settings , "<STR_LIT>" , <NUM_LIT:3> ) ) <EOL> @ property <EOL> def EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , <EOL> None ) <EOL> @ property <EOL> def EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL ( self ) : <EOL> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> return self . _setting ( "<STR_LIT>" , <EOL> settings . LOGIN_URL ) <EOL> @ property <EOL> def EMAIL_REQUIRED ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , False ) <EOL> @ property <EOL> def EMAIL_VERIFICATION ( self ) : <EOL> """<STR_LIT>""" <EOL> ret = self . _setting ( "<STR_LIT>" , <EOL> self . EmailVerificationMethod . OPTIONAL ) <EOL> if ret is True : <EOL> ret = self . EmailVerificationMethod . MANDATORY <EOL> elif ret is False : <EOL> ret = self . EmailVerificationMethod . OPTIONAL <EOL> return ret <EOL> @ property <EOL> def AUTHENTICATION_METHOD ( self ) : <EOL> from django . conf import settings <EOL> if hasattr ( settings , "<STR_LIT>" ) : <EOL> import warnings <EOL> warnings . warn ( "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> DeprecationWarning ) <EOL> if getattr ( settings , "<STR_LIT>" ) : <EOL> ret = self . AuthenticationMethod . EMAIL <EOL> else : <EOL> ret = self . AuthenticationMethod . USERNAME <EOL> else : <EOL> ret = self . _setting ( "<STR_LIT>" , <EOL> self . AuthenticationMethod . USERNAME ) <EOL> return ret <EOL> @ property <EOL> def UNIQUE_EMAIL ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , True ) <EOL> @ property <EOL> def SIGNUP_PASSWORD_VERIFICATION ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , True ) <EOL> @ property <EOL> def PASSWORD_MIN_LENGTH ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , <NUM_LIT:6> ) <EOL> @ property <EOL> def EMAIL_SUBJECT_PREFIX ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , None ) <EOL> @ property <EOL> def SIGNUP_FORM_CLASS ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , None ) <EOL> @ property <EOL> def USERNAME_REQUIRED ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , True ) <EOL> @ property <EOL> def USERNAME_MIN_LENGTH ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , <NUM_LIT:1> ) <EOL> @ property <EOL> def USERNAME_BLACKLIST ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , [ ] ) <EOL> @ property <EOL> def PASSWORD_INPUT_RENDER_VALUE ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( "<STR_LIT>" , False ) <EOL> @ property <EOL> def ADAPTER ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> @ property <EOL> def CONFIRM_EMAIL_ON_GET ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , False ) <EOL> @ property <EOL> def AUTHENTICATED_LOGIN_REDIRECTS ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , True ) <EOL> @ property <EOL> def LOGIN_ON_EMAIL_CONFIRMATION ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( '<STR_LIT>' , False ) <EOL> @ property <EOL> def LOGIN_ON_PASSWORD_RESET ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( '<STR_LIT>' , False ) <EOL> @ property <EOL> def LOGOUT_REDIRECT_URL ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , '<STR_LIT:/>' ) <EOL> @ property <EOL> def LOGOUT_ON_GET ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , False ) <EOL> @ property <EOL> def LOGOUT_ON_PASSWORD_CHANGE ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , False ) <EOL> @ property <EOL> def USER_MODEL_USERNAME_FIELD ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , '<STR_LIT:username>' ) <EOL> @ property <EOL> def USER_MODEL_EMAIL_FIELD ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , '<STR_LIT:email>' ) <EOL> @ property <EOL> def SESSION_COOKIE_AGE ( self ) : <EOL> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> return self . _setting ( '<STR_LIT>' , settings . SESSION_COOKIE_AGE ) <EOL> @ property <EOL> def SESSION_REMEMBER ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( '<STR_LIT>' , None ) <EOL> @ property <EOL> def TEMPLATE_EXTENSION ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( '<STR_LIT>' , '<STR_LIT:html>' ) <EOL> @ property <EOL> def FORMS ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , { } ) <EOL> @ property <EOL> def LOGIN_ATTEMPTS_LIMIT ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( '<STR_LIT>' , <NUM_LIT:5> ) <EOL> @ property <EOL> def LOGIN_ATTEMPTS_TIMEOUT ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _setting ( '<STR_LIT>' , <NUM_LIT> * <NUM_LIT:5> ) <EOL> @ property <EOL> def EMAIL_CONFIRMATION_HMAC ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , True ) <EOL> @ property <EOL> def SALT ( self ) : <EOL> return self . _setting ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> import sys <EOL> app_settings = AppSettings ( '<STR_LIT>' ) <EOL> app_settings . __name__ = __name__ <EOL> sys . modules [ __name__ ] = app_settings </s>
