User model mixins.
Project description
django-user-mixins
User model mixins based on Django.
user_mixins model mixins give flexibility to create your own User model.
By default all mixins are optional. Our mixins allow to create, identify users
(from their emails instead of their username) as well as sending password reset
and account validation emails.
Installation
Install the package:
pip install django-user-mixins
Install with avatar functionality:
pip install django-user-mixins[avatar]
User model
To create a custom user model using the django-user-mixins functionality, declare
your user class like this:
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from user_mixins.mixins import ActiveUserMixin
class User(ActiveUserMixin, PermissionsMixin, AbstractBaseUser):
pass
If you want to use the VerifyEmailMixin, substitute it for ActiveUserMixin.
Make sure the app containing your custom user model is added to settings.INSTALLED_APPS,
and set settings.AUTH_USER_MODEL to be the path to your custom user model.
If you use EmailUserMixin or any of its derivatives, you'll need to set up Postgres to support a CIText extension in your migration. Add the following to your migration:
from django.contrib.postgres.operations import CITextExtension
operations = [
CITextExtension(),
...
]
Mixins
ActiveUserMixin
user_mixins.mixins.ActiveUserMixin provides a base custom user
mixin with a name, email, date_joined, is_staff, and is_active.
VerifyEmailMixin
user_mixins.mixins.VerifyEmailMixin extends ActiveUserMixin to
provide functionality to verify the email. It includes an additional
email_verified field.
By default, users will be created with is_active = False. A verification email
will be sent including a link to verify the email and activate the account.
AvatarMixin
user_mixins.mixins.AvatarMixin adds an avatar field. The
serializers for this field require django-imagekit to be installed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-user-mixins-0.0.1.tar.gz.
File metadata
- Download URL: django-user-mixins-0.0.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8cab792a1e7c4be7fe218e5c2873d4d6162f61dd4f39a120b4e003541cb504f
|
|
| MD5 |
2c7228cb06e2522f3e6532a4b0174c34
|
|
| BLAKE2b-256 |
d169276b0e34aa07eb6a24431bfb68ed32afc77d38e3847bb9c0140be0c3ffb3
|
File details
Details for the file django_user_mixins-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: django_user_mixins-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c594d9b7e3d3d7e38c9ba3e81fadf7070bfef5f188858a0a7276192eff7f84b5
|
|
| MD5 |
a22e686f1f12aba38b4ac35b3055553e
|
|
| BLAKE2b-256 |
d750a8d76d4d1b20e421c8bf1f5e86ca9e99f8907d6d2d7918af0353f2dd8380
|