registration.backends package

Submodules

registration.backends.base module

class registration.backends.base.RegistrationBackendBase[source]

Bases: object

Base class of registration backend

get_site -- return current site
register -- register a new user
accept -- accept a registration
reject -- reject a registration
activate -- activate a user
get_supplement_class -- get registration supplement class
get_activation_form_class -- get activation form class
get_registration_form_class -- get registration form class
get_supplement_form_class -- get registration supplement form class
get_activation_complete_url -- get activation complete redirect url
get_registration_complete_url -- get registration complete redirect url
get_registration_closed_url -- get registration closed redirect url
registration_allowed -- whether registration is allowed now
accept(profile, request, send_email=True, message=None, force=False)[source]

accept account registration with given profile (an instance of RegistrationProfile)

Returning should be a instance of accepted User for success, None for fail.

This method SHOULD work even after the account registration has rejected.

activate(activation_key, request, password=None, send_email=True, message=None, no_profile_delete=False)[source]

activate account with activation_key and password

This method should be called after the account registration has accepted, otherwise it should not be success.

Returning is user, password and is_generated for success, None for fail.

If password is not given, this method will generate password and is_generated should be True in this case.

get_activation_complete_url(user)[source]

get activation complete url

get_activation_form_class()[source]

get activation form class

get_registration_closed_url()[source]

get registration closed url

get_registration_complete_url(user)[source]

get registration complete url

get_registration_form_class()[source]

get registration form class

get_site(request)[source]

get current django.contrib.Site instance

return django.contrib.RequestSite instance when the Site is not installed.

get_supplement_class()[source]

Return the current registration supplement class

get_supplement_form_class()[source]

get registration supplement form class

register(username, email, request, supplement=None, send_email=True)[source]

register a new user account with given username and email

Returning should be a instance of new User

registration_allowed()[source]

return False if the registration has closed

reject(profile, request, send_email=True, message=None)[source]

reject account registration with given profile (an instance of RegistrationProfile)

Returning should be a instance of accepted User for success, None for fail.

This method SHOULD NOT work after the account registration has accepted.

Module contents

registration.backends.get_backend(path=None)[source]

Return an instance of a registration backend, given the dotted Python import path (as a string) to the backend class.

If the backend cannot be located (e.g., because no such module exists, or because the module does not contain a class of the appropriate name), django.core.exceptions.ImproperlyConfigured is raised.

class registration.backends.RegistrationBackendBase[source]

Bases: object

Base class of registration backend

get_site -- return current site
register -- register a new user
accept -- accept a registration
reject -- reject a registration
activate -- activate a user
get_supplement_class -- get registration supplement class
get_activation_form_class -- get activation form class
get_registration_form_class -- get registration form class
get_supplement_form_class -- get registration supplement form class
get_activation_complete_url -- get activation complete redirect url
get_registration_complete_url -- get registration complete redirect url
get_registration_closed_url -- get registration closed redirect url
registration_allowed -- whether registration is allowed now
accept(profile, request, send_email=True, message=None, force=False)[source]

accept account registration with given profile (an instance of RegistrationProfile)

Returning should be a instance of accepted User for success, None for fail.

This method SHOULD work even after the account registration has rejected.

activate(activation_key, request, password=None, send_email=True, message=None, no_profile_delete=False)[source]

activate account with activation_key and password

This method should be called after the account registration has accepted, otherwise it should not be success.

Returning is user, password and is_generated for success, None for fail.

If password is not given, this method will generate password and is_generated should be True in this case.

get_activation_complete_url(user)[source]

get activation complete url

get_activation_form_class()[source]

get activation form class

get_registration_closed_url()[source]

get registration closed url

get_registration_complete_url(user)[source]

get registration complete url

get_registration_form_class()[source]

get registration form class

get_site(request)[source]

get current django.contrib.Site instance

return django.contrib.RequestSite instance when the Site is not installed.

get_supplement_class()[source]

Return the current registration supplement class

get_supplement_form_class()[source]

get registration supplement form class

register(username, email, request, supplement=None, send_email=True)[source]

register a new user account with given username and email

Returning should be a instance of new User

registration_allowed()[source]

return False if the registration has closed

reject(profile, request, send_email=True, message=None)[source]

reject account registration with given profile (an instance of RegistrationProfile)

Returning should be a instance of accepted User for success, None for fail.

This method SHOULD NOT work after the account registration has accepted.