Skip to main content

Django Easy Login

Django Easy Login is a Django app that allows end-users to login with already created users at the system without authentication.

Quick start

  1. Add ‘easy_login’ to your INSTALLED_APPS settings:

INSTALLED_APPS = [
...
'easy_login',
...
]
  1. Now edit the example/urls.py module in your project:

urlpatterns = [
...
url(r'^easy_login/', include('easy_login.urls', namespace='easy-login')),
...
]
  1. Set middleware class:

TEMPLATES = [
    ...
    'context_processors': [
        'easy_login.context_processors.easy_login',
    ...
    ],
]
  1. Define default url redirect:

EASY_URL_REDIRECT = 'test-app:index'
  1. In template define easy_login variable:

{{ easy_login }}

Customization

You can change the view settings up to your wishes. For customizing view settings please put this to the settings:

EASY_LOGIN_SETTINGS = {
'FILTER': {},           # --> dict;
'LIMIT': None,          # --> int;
'LABELS': [],           # --> list, lambda;
'LOGIN_BY': '',         # --> str;
'GET_BY': '',           # --> str;
'LOGIN_BUTTON': ''      # --> str;
}

Options:

  • FILTER - possible type - dict; Using this option you can by the attributes filter objects which are shown in the select bar. For example 'FILTER': {'username': 'admin'}. By default - None.

  • LIMIT - possible type - int; Limit number of records in dropdown. You can put None if you don’t want to limit the number of users for select. By default - 10.

  • LABELS - possible type - list, lambda; You can change the label of users displayed in dropdown. For example you can add roles, permissions and any other important information. Also, you can use lambda expression here, for ex. 'LABELS': lambda x: x.username + ' - ' + str(x.id). By default - __str__ method of your object.

  • LOGIN_BY - possible type - str, values: ‘select’, ‘id’, ‘both’; You can enable login with select field, ID input or both. By default - ‘both’.

  • GET_BY - possible type - str; You can change attribute by which you will authorize. By default - ‘id’.

  • LOGIN_BUTTON - possible type - str; You can change login button label. By default - ‘Login’.

Release files for django-easy-login 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-easy-login 0.1.1
File Size Uploaded
django-easy-login-0.1.1.tar.gz 12.3 kB Details

Release files / django-easy-login-0.1.1.tar.gz

Download URL django-easy-login-0.1.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bb806821b9b1121b5e2bec9566d018757b26563bf2ee435ae49464a3f185e403
BLAKE2b-256 checksum
How to use checksums
b7256b6cf22d9a5079a4a60a1da148a92b68cf9ef8d34152699b8289ee5a3e05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page