Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

User APP for Django REST Framework with API Views

Project description

Django REST Framework - User

User APP for Django REST Framework with API Views.

DRF User is a Django app that overrides default user app to provide additional attributes and functionalities. The current stable version includes:

  • [x] Mobile Number
  • [x] Single field for full name
  • [x] REST API to register
  • [x] REST API to login
  • [x] MultiModelBackend: User can login using either of mobile, email or username
  • [x] REST API to login with OTP (Same API endpoint as for OTP Verification; Set is_login: true while sending JSON request)
  • [x] OTP Verification for mobile and email
  • [x] API to register / login with OTP (no pre-registration required)
  • [x] Mail sending feature upon successful registration
  • [x] SMS sending feature upon successful registration
  • [x] Change Password
  • [x] Update Profile
  • [x] based configuration
  • [ ] Signal based mails: Pending in OTP section
  • [ ] Mail based activation (optional alternative for OTP based activation)


  • Civil Machines Technologies Private Limited: For providing me platform and funds for research work. This project is hosted currently with CMT only.
  • Himanshu Shankar: The app was initiated and worked upon majorly by Himanshu. This app is currently in use in various other django projects that are developed by him.
  • Aditya Gupta: Aditya has updated view in the app to include additional features such as Change Password. He is also an active contributor in this repository and is working to replace ValidateAndPerformView with appropriate Django REST Framework GenericAPI Views.

** We're looking for someone who can contribute on docs part **


  • Download and Install via pip
pip install drf_user


Download and Install via easy_install

easy_install drf_user
  • Add drf_user in INSTALLED_APPS
  • Also add other dependencies in INSTALLED_APPS
  • Include urls of drf_user in
urlpatterns = [
    path('api/user/', include('drf_user.urls')),

# or

urlpatterns = [
    url(r'^api/user/', include('drf_user.urls')),
  • Include AUTH_USER_MODEL in
AUTH_USER_MODEL = 'drf_user.User'
  • Finally, run migrate command
python migrate drf_user

Additional settings

These additional settings are required to use drf_user at its full extent. These settings should be done in

  • Set JWT_PAYLOAD_HANDLER in JWT_AUTH configurations
    'JWT_PAYLOAD_HANDLER': 'drf_user.auth.jwt_payload_handler',

Manual Settings

User can define manual setting in file in USER_SETTINGS variable . Default options are provided below

user_settings = {
    'OTP': {
        'LENGTH': 7,
        'ALLOWED_CHARS': '1234567890',
        'SUBJECT': 'OTP for Verification',
        'COOLING_PERIOD': 3
        'SEND_MAIL': False,
        'SEND_MESSAGE': False,
        'MAIL_SUBJECT': 'Welcome to DRF-USER',
        'SMS_BODY': 'Your account has been created',
        'TEXT_MAIL_BODY': 'Your account has been created.',
        'HTML_MAIL_BODY': 'Your account has been created.'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for drf-user, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size drf_user-0.0.8-py3-none-any.whl (35.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size drf_user-0.0.8.tar.gz (16.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page