Accounts

Forms

An account forms.

class apps.accounts.forms.BruteForceCheckMixin(*args, **kwargs)

depends on RequestModelForm

is_valid(*args, **kwargs)

Increase brute force iteration value if form is invalid

Parameters:
  • args
  • kwargs
Returns:

is_valid statement (True or False)

save(commit=True)

Save brute force iteration value

Parameters:commit – saves form instance, True by default
Returns:form instance
class apps.accounts.forms.LoginForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)

Login Form

class apps.accounts.forms.PasswordChangeForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None)

Password Change Initiation Form

class apps.accounts.forms.PasswordRestoreForm(*args, **kwargs)

Password Restore Form

class apps.accounts.forms.PasswordRestoreInitiateForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)

Password Restore Initiation Form

Models

Models

class apps.accounts.models.User(*args, **kwargs)

Base class implementing a fully featured User model with admin-compliant permissions.

Username, password and email are required. Other fields are optional.

static get_change_password_url()

returns change password url

get_full_name()

Returns the first_name plus the last_name, with a space in between.

get_group_permissions(obj=None)

Returns a list of permission strings that this user has through their groups. This method queries all available auth backends. If an object is passed in, only permissions matching this object are returned.

static get_profile_url()

returns profile url

static get_recover_password_url()

returns recover password url

get_short_name()

Returns the short name for the user.

has_module_perms(app_label)

Returns True if the user has any permissions in the given app label. Uses pretty much the same logic as has_perm, above.

has_perm(perm, obj=None)

Returns True if the user has the specified permission. This method queries all available auth backends, but returns immediately if any backend returns True. Thus, a user who has permission from a single auth backend is assumed to have permission in general. If an object is provided, permissions for this specific object are checked.

has_perms(perm_list, obj=None)

Returns True if the user has each of the specified permissions. If object is passed, it checks if the user has all required perms for this object.

class apps.accounts.models.UserSID(*args, **kwargs)

UserSID class for security hashes store, uses for password recover process

Views

Class based views

An account classed based views.

class apps.accounts.views.IndexView(**kwargs)

Index view

class apps.accounts.views.LoginView(**kwargs)

serves for account login into current web application

form_class

alias of LoginForm

class apps.accounts.views.LogoutView(**kwargs)

serves for log out registered and logged in user for current web app

class apps.accounts.views.PasswordChangeView(**kwargs)

Password Change View

starts password change process (if user remembers his current password and he/she is logged in)

form_class

alias of PasswordChangeForm

model

alias of User

class apps.accounts.views.PasswordRestoreInitiateView(**kwargs)

Password Restore Initiate View

starts password restore process (initiates)

form_class

alias of PasswordRestoreInitiateForm

class apps.accounts.views.PasswordRestoreView(**kwargs)

Password Restore View

restores forgotten password

form_class

alias of PasswordRestoreForm

class apps.accounts.views.ProfileView(**kwargs)

Profile View

show user profile

Signals

Signals

apps.accounts.signals.user_pre_saved(instance, **kwargs)

user pre save signal

Parameters:instance (apps.accounts.models.User) – user instance
Return type:apps.accounts.models.User
Returns:user instance
apps.accounts.signals.setup_signals()

setups signals