Welcome to Django Tasker Account’s documentation!¶
Features¶
- Geocoding user (Automatic determination of the user’s location during registration)
- Automatic time zone change depending on user settings
- Automatic language change depending on user settings
- User Profile
- Timezone
- Language
- Gender
- Birth date
- Mobile phone
- Avatar
- OAuth
- Provider
- VK.com
- Yandex
- Filling user profile from provider OAuth
- Automatic download avatar
- Pages
- Login page
- Sign up page (sending a confirmation email)
- Page forgot password
- User profile page
- Page change password
- Page change firstname, lastname, gender, birth date
- Page change country and city
- Set 2FA
- Upload avatar
Requirements¶
- Python 3.6+
- A supported version of Django (currently 2.2)
Getting It¶
You can get Django Tasker Account by using pip:
$ pip install django-tasker-account
If you want to install it from source, grab the git repository from GitHub and run setup.py:
$ git clone git://github.com/kostya-ten/django_tasker_account.git
$ cd django_tasker_account
$ python setup.py install
Installation¶
To enable django_tasker_account
in your project you need to add it to INSTALLED_APPS in your projects settings.py
INSTALLED_APPS = (
# ...
'django_tasker_account',
'django_tasker_geobase',
'mptt',
# ...
)
Configuring¶
Option | Default | Description |
---|---|---|
YANDEX_MAP_KEY | Required | The Geocoder can get a geo object’s coordinates |
YANDEX_LOCATOR_KEY | Optional | Locator locates the user |
GEOIP_PATH | Required | Geolocation with GeoIP2 documentation |
EMAIL_HOST | Required | |
TASKER_HTML_INPUT_CLASS | Optional | Class html input form |
TASKER_ACCOUNT_SESSION_SIGNUP | 1 day | |
TASKER_ACCOUNT_SESSION_FORGOTPASSWORD | 1 day | |
OAUTH_YANDEX_CLIENT_ID | Optional | OAuth client id from yandex |
OAUTH_YANDEX_SECRET_KEY | Optional | OAuth secret key from yandex |
OAUTH_MAILRU_CLIENT_ID | Optional | OAuth client id from mail.ru |
OAUTH_MAILRU_SECRET_KEY | Optional | OAuth secret key from mail.ru |
OAUTH_GOOGLE_CLIENT_ID | Optional | OAuth client id from Google |
OAUTH_GOOGLE_SECRET_KEY | Optional | OAuth secret key from Google |
OAUTH_VK_CLIENT_ID | Optional | OAuth client id from VK.com |
OAUTH_VK_SECRET_KEY | Optional | OAuth secret key from VK.com |
OAUTH_FACEBOOK_CLIENT_ID | Optional | OAuth client id from Facebook |
OAUTH_FACEBOOK_SECRET_KEY | Optional | OAuth secret key from Facebook |
Where to get the keys?¶
YANDEX_MAP_KEY - https://tech.yandex.com/maps/
YANDEX_LOCATOR_KEY - https://tech.yandex.ru/locator/ (Russian)
Geobase¶
Validators¶
-
django_tasker_account.validators.
email
(email: str) → str¶ Checks the validity syntax of an email
Parameters: email – email address Returns: email Raise: ValidationError If the incorrect email address
-
django_tasker_account.validators.
email_blacklist
(email: str) → str¶ Checks the blacklist db an email
Parameters: email – email address Returns: email Raise: ValidationError If the email address is blacklist db
-
django_tasker_account.validators.
email_dublicate
(email: str) → str¶ Checks the dublicate an email
Parameters: email – email address Returns: email Raise: ValidationError If the email address is dublicate
-
django_tasker_account.validators.
email_exists
(email: str) → str¶ Checks the not exists an email
Parameters: email – email address Returns: email Raise: ValidationError If the email address is not exists
-
django_tasker_account.validators.
mobile_number
(number: int) → str¶ Checks the validity of a mobile phone number.
Parameters: number – mobile phone number. Returns: number Raise: ValidationError If the mobile phone number is not valid
-
django_tasker_account.validators.
password
(password: str) → str¶ Checks the password syntax
Parameters: password – password Returns: password Raise: ValidationError If the password is not correct
-
django_tasker_account.validators.
username
(username: str) → str¶ Checks the validity of an username.
Parameters: username – User name сhecked. Returns: username Raise: ValidationError If the username is not a regular expression ^[a-z]+[a-z0-9]+[_-]?[a-z0-9]+$
-
django_tasker_account.validators.
username_dublicate
(username: str) → str¶ Checks the dublicate an username.
Parameters: username – User name сhecked. Returns: username Raise: ValidationError If the username is dublicate
Views¶
-
django_tasker_account.views.
change_password
(request: django.core.handlers.wsgi.WSGIRequest, data: django_tasker_account.converters.ChangePassword)¶ Password change view
-
django_tasker_account.views.
confirm_email
(request: django.core.handlers.wsgi.WSGIRequest, data: django_tasker_account.converters.ConfirmEmail)¶ View for confirmation email address
-
django_tasker_account.views.
forgot_password
(request: django.core.handlers.wsgi.WSGIRequest)¶ View forgot password
-
django_tasker_account.views.
login
(request: django.core.handlers.wsgi.WSGIRequest)¶ View for user authentication
-
django_tasker_account.views.
signup
(request: django.core.handlers.wsgi.WSGIRequest)¶ View for user registration
\ Sort by:\ best rated\ newest\ oldest\
\\
Add a comment\ (markup):
\``code``
, \ code blocks:::
and an indented block after blank line