Password field for Django with the eye icon to show/hide password text
Project description
Django Password Eye
A Django field and widget to show the 'eye' icon that shows and hides password.
Install
pip install django-password-eye
In settings, add django_password_eye
to INSTALLED_APPS:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
...
'django_password_eye',
]
By default, it includes the Font Awesome css library
If you do not want to include it because you already include it from another template, just set this in your settings f``ile:
DJANGO_PASSWORD_EYE_INCLUDE_FONT_AWESOME = False
Requires
JQuery, Bootstrap and Font Awesome. They are included in the widget.
Usage
Import PasswordEye and use it instead of the traditional Password field.
from django_password_eye.fields import PasswordEye
class LoginForm(forms.Form):
username = forms.CharField(max_length=150,
widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': _('Login')}),
`` label='')
password = PasswordEye(label='')
CSS classes
Check template input.html.
I suggest to modify link
class to add cursor: hand/pointer, but it is up to you.
Source code
The code was taken from this link
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-password-eye-1.0.3.tar.gz
(41.7 kB
view hashes)
Close
Hashes for django-password-eye-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 809f3930bd26959f148b94ab6daeb87d3e7b94373492f20d19f0157fd5d09355 |
|
MD5 | dae61eb107fe5fa0507a242c0581bed7 |
|
BLAKE2b-256 | 9010b40c1aa00645efdd5bf93131ab0852b2d41f149961fe2dc2c31230e7e2fe |