Django Admin Two Factor Authentication
Project description
Django Admin Two-Factor Authentication
Django Admin Two-Factor Authentication, allows you to login django admin with google authenticator.
Why Django Admin Two-Factor Authentication?
- Using google authenticator to login your Django admin.
- Used jquery confirm dialog to get code.
- Simple interface
- Easy integration
How to use it
- Download and install last version of Django Admin Two-Factor Authentication:
$ pip install django-admin-two-factor
# or
$ easy_install django-admin-two-factor
- Add 'admin_two_factor' application to the INSTALLED_APPS setting of your Django project
settings.py
file (note it should be before 'django.contrib.admin'):
INSTALLED_APPS = (
'admin_two_factor.apps.TwoStepVerificationConfig',
'django.contrib.admin',
# ...
)
- Migrate
admin_two_factor
:
$ python manage.py migrate admin_two_factor
$ # or
$ python manage.py syncdb
- Add
ADMIN_TWO_FACTOR_NAME
in yoursettings.py
. This value will be displayed in Google Authenticator.
ADMIN_TWO_FACTOR_NAME = 'PROJECT_NAME'
- Include the Admin Two Factor URL config in
PROJECT_CORE/urls.py
:
urlpatterns = [
path('admin/', admin.site.urls),
path('two_factor/', include(('admin_two_factor.urls', 'admin_two_factor'), namespace='two_factor')),
# ...
]
- Collect static if you are in production environment:
$ python manage.py collectstatic
- Clear your browser cache
Start the app
$ # Set up the database
$ python manage.py makemigrations
$ python manage.py migrate
$
$ # Create the superuser
$ python manage.py createsuperuser
$
$ # Start the application (development mode)
$ python manage.py runserver # default port 8000
- Access the
admin
section in the browser:http://127.0.0.1:8000/
ScreenShoots
- User List: the users who have enabled two-factor auth
- Add New User:
- Scan QRCode and enter the valid code:
- Logout and login again with Google Authenticator:
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-admin-two-factor-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 994967635f6c74bdb7100c5f9cbed76552e0473e41a0cc086d79866584b465d8 |
|
MD5 | 2c4c7d427b7ab69c5891f5241835bafa |
|
BLAKE2b-256 | 8a4abbcfc56795640a2a4cf5c6fb3fff2e89ca2934b5a72c0416de3bdac88075 |
Close
Hashes for django_admin_two_factor-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 647405cf436544ba007292f920dc3bf355c6caf607050c067da68d5bd4b3f2f5 |
|
MD5 | 1829c011d43c880fda5cc99976d84925 |
|
BLAKE2b-256 | 9153ef14e0fb843beea75cb52df56d7d1e6f7dbc9d9d4c8e1e5c6fe20c61b44e |