User¶
Note
The User model base on AUTH_USER_MODEL
Field settings¶
-
USER_FIELDS¶ The fields of the User use for Register and Profile
Default:
( 'id', 'username', 'email', 'password', 'is_active', )
Make sure your fields include
username,email, andpassword.
-
USER_READ_ONLY_FIELDS¶ The read only fields for serializers
Default:
( 'is_superuser', 'is_staff', 'is_active', )
-
USER_WRITE_ONLY_FIELDS¶ The write only fields for Profile serializers. Make sure those fields can not update after created.
Default:
( 'password', 'username', )
-
USER_SERIALIZER¶ The User Serializer use dotted path
Default:
'drf_registration.api.user.UserSerializer'
Verify/Activate settings¶
Those configurations for the Register flow.
-
USER_VERIFY_FIELD¶ The User verify/activate field
Default:
'is_active'
-
USER_ACTIVATE_TOKEN_ENABLED¶ Enable verify use by token sent to email
Default:
False
-
USER_ACTIVATE_EMAIL_SUBJECT¶ The activate email subject
Default:
'Activate your account'Note
It only works with
USER_ACTIVATE_TOKEN_ENABLEDisTrue
-
USER_ACTIVATE_EMAIL_TEMPLATE¶ The activate email template path
Default:
NoneIf not set, the default template message is
<p>By clicking on the following link, you are activating your account</p> <a href="{activate_link}">Activate Account</a>
Note
It only works with
USER_ACTIVATE_TOKEN_ENABLEDisTrue
-
USER_ACTIVATE_SUCCESS_TEMPLATE¶ The template path when activate user successfully.
Default:
NoneIf not set, the system will show the default message is
Your account has been activate successfullyNote
It only works with
USER_ACTIVATE_TOKEN_ENABLEDisTrue
-
USER_ACTIVATE_FAILED_TEMPLATE¶ The template path when activate user failed.
Default:
NoneIf not set, the system will show the default message is
Either the provided activation token is invalid or this account has already been activated.Note
It only works with
USER_ACTIVATE_TOKEN_ENABLEDisTrue