Skip to main content

A Django app that provides authentication, password change, password reset and account verification functionalities.

Project description

“django-auth-essentials” is a Django app that provides all the basic and necessary authentication and account verification functionalities you need for your django project, out of the bat. Once successfully integrated to your project, you don’t need to worry about register, login/logout, password change/reset functionalities as “django-auth-essentials” takes care of those. “django-auth-essentials” also provides email/account verification options to make your life easier.

Detailed documentation is in the “docs” directory.

Quick start

  1. Add django_auth_essentials to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'django_auth_essentials',
    ]
  2. Include the django_auth_essentials URLconf in your project urls.py like this:

    path('accounts/', include('django_auth_essentials.urls')),
  3. Start the development server python manage.py runserver.

  4. Visit http://127.0.0.1:8000/accounts/login/ to test it yourself.

Configuration

With above steps, you’ve successfully integrated “django_auth_essentials” to your project. But there is more you can do with “django_auth_essentials”. It comes with several different configuration options. You can configure it as per your project requirements.

The initial integration already provides register, login/logout and password changing functionalities. Below are some extra and handy configurations for “django_auth_essentials”.

User Email Configurations

REQUIRE_EMAIL determines whether email is required when registering:

# by default it's set to False (Not required)
REQUIRE_EMAIL = True

UNIQUE_EMAIL determines if registering email should be unique or not:

# by default it's set to False (Not unique)
UNIQUE_EMAIL = True

ALLOW_VERIFICATION determines the integration of email verification feature:

# by default it's set to False (No verification)
ALLOW_VERIFICATION = True

NOTE: If you have this setting turned on you don’t need to specify UNIQUE_EMAIL or REQUIRE_EMAIL

Password Reset Configuration

ALLOW_PASSWORD_RESET determines the integration of password resetting feature:

# by default it's set to False (Not integrated)
ALLOW_PASSWORD_RESET = True

NOTE: For ALLOW_VERIFICATION and ALLOW_PASSWORD_RESET settings to work, you need to specify email settings for your project. Verification email and password resetting email will utilize those settings. For example:

...
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

# This Configuration is for gmail
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'yourmail@gmail.com'
EMAIL_HOST_PASSWORD = 'yourpassword'

Access Restricting Configurations

NOTE: If you defined your own access restriction logics, you can avoid these settings completely.

RESTRICT_UNAUTHENTICATED_USER_ACCESS determines if “django_auth_essentials” ‘s default access restriction for unauthenticated users to regitration, login, password reset and email verification pages only should be implemented:

# by default set to False (Not implemented)
RESTRICT_UNAUTHENTICATED_USER_ACCESS = True

LOGIN_REQUIRED_EXEMPT_URLS a List | Let’s you add custom urls you want to be accessible to the unauthenticated users if you have RESTRICT_UNAUTHENTICATED_USER_ACCESS turned on:

LOGIN_REQUIRED_EXEMPT_URLS = [
    'allow/path/one/',
    'allow/path/two/',
]

UNAUTHENTICATED_SPECIFIC_URLS a List | Let’s you add custom urls you want to be accessible specificly to the unauthenticated users:

UNAUTHENTICATED_SPECIFIC_URLS = [
    'auth-user/not-allowed/one/',
    'auth-user/not-allowed/two/',
]

NOTE: If you have any dynamic urls you want to include in the LOGIN_REQUIRED_EXEMPT_URLS and/or UNAUTHENTICATED_SPECIFIC_URLS configurations, simply specify the url path leading upto the dynamic part. For example if your dynamic url is something like “dynamic/url/<pk>/” all you need to do is add “dynamic/url/” to the desired setting.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

django-auth-essentials-1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_auth_essentials-1.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file django-auth-essentials-1.0.tar.gz.

File metadata

  • Download URL: django-auth-essentials-1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for django-auth-essentials-1.0.tar.gz
Algorithm Hash digest
SHA256 b941f5d0756a0b7874ad76524d2a885fcf15166ef69206ff83a61519321fb045
MD5 54f725e10cbb2c6367859b4d2183766a
BLAKE2b-256 8c596c886af9270047389f5411dd9d71d240c460eb9fe6c235df091b5eb1d9ed

See more details on using hashes here.

File details

Details for the file django_auth_essentials-1.0-py3-none-any.whl.

File metadata

  • Download URL: django_auth_essentials-1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for django_auth_essentials-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3a18e4fc869e2f3676a52e1712f7409521b34ce2f664bba682ddd9ba8d79778
MD5 47446a771c56eedc5b5653defdc19fcb
BLAKE2b-256 bcde0ae0c5d0db6b55c353b056668958807cea0627707d31f90e6e120b3db913

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page