A custom user model for django authentication
Project description
Django custom user model
A Custom User model for authentication
Requirement
- Python (3.5, 3.6, 3.7, 3.8)
- Django (1.11, >2.0, 2.1, 2.2, 3.0, 3.1)
Installation
Install using pip
pip install django-custom-user-models
Add to INSTALLED_APPS
setting
INSTALLED_APPS = {
...
'CustomAuth',
...
}
Set AUTH_USER_MODEL
setting before first migrate
AUTH_USER_MODEL = 'CustomAuth.User'
Migrate apps
py manage.py migrate
Usage
Status Handler
Add handler
to yourproject/urls.py
from CustomAuth.urls import handler400, handler401, handler403, handler404, handler500
Authentication template
profile url
Add to settings.py
USER_PROFILE_URL = 'your user profile url' # default '/profile/'
logout redirect url
Add to settings.py
LOGOUT_REDIRECT = 'your logout redirect' # default '/'
signup successfully redirect
Add to settings.py
SIGNUP_SUCCESSFULLY_URL = 'your signup successfully redirect url' # default '/profile/'
verification successfully redirect
Add to settings.py
VERIFY_SUCCESSFULLY = 'your verify successfully redirect url' # default '/profile/'
verification failed redirect
Add to settings.py
VERIFY_FAILED = 'your verify failed redirect url' # default 'Verification link is invalid!'
Gmail config
For verify email you must config email smtp server
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'your name@gmail.com'
EMAIL_HOST_PASSWORD = 'your password'
EMAIL_USE_TSL = True
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
EMAIL_FROM = EMAIL_HOST_USER
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
License
Uses the MIT license.
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
Close
Hashes for django-custom-user-models-0.0.51.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd9c4b7737f7ac229359ff3e5858b3cf1dc2078805769c365d1ccb24f08e734 |
|
MD5 | 1682d3958b7e64b8a6eed24d9640b9a6 |
|
BLAKE2b-256 | 7bcb212d5ccc375647d2fdf064a480967c511da5e37aaf6de0f5e8e4559a7c35 |
Close
Hashes for django_custom_user_models-0.0.51-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa84793f4d4a4007d8453e3ab4660af1d8ca57ed88dc01aabd98199bc281d4aa |
|
MD5 | 6d4f4c5865edf72d31f5d792c81d20e6 |
|
BLAKE2b-256 | d80e41edd36d69ae747ca70705bb58de58b8886dfed55eb6540055e2e44a3a63 |