# HG changeset patch # User Gustavo Andres Morero # Date 1597354667 10800 # Thu Aug 13 18:37:47 2020 -0300 # Node ID 0cf38c9d3dcc4dbfaec1f8a3e1f1dc9765d3be74 # Parent 14b8533e0a816cb5cb575411c672c37e8a2d7aaf updating installation section on README.md diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -9,41 +9,42 @@ ## Installation -1. Add `django_otp`, `django_otp.plugins.otp_totp`, `django_otp.plugins.otp_static` and `nlotp` to `INSTALLED_APPS`. - -1. Add `nlotp.middleware.OTPCheckMiddleware` to `MIDDLEWARE`. It must be installed after `django.contrib.auth.middleware.AuthenticationMiddleware`. - -So it will looks like this: - -```python +1. Add `django_otp`, `django_otp.plugins.otp_totp`, `django_otp.plugins.otp_static` and `nlotp` to `INSTALLED_APPS`. For example: -INSTALLED_APPS = [ - "django.contrib.admin", - "django.contrib.auth", - "django.contrib.contenttypes", - "django.contrib.sessions", - "django.contrib.messages", - "django.contrib.staticfiles", + INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + + 'django_otp', + 'django_otp.plugins.otp_totp', + 'django_otp.plugins.otp_static', + 'nlotp', + ] + +1. Add `nlotp.middleware.OTPCheckMiddleware` to `MIDDLEWARE`. It must be installed after `django.contrib.auth.middleware.AuthenticationMiddleware`. For example: - "django_otp", - "django_otp.plugins.otp_totp", - "django_otp.plugins.otp_static", - "nlotp", -] + MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', -MIDDLEWARE = [ - "django.middleware.security.SecurityMiddleware", - "django.contrib.sessions.middleware.SessionMiddleware", - "django.middleware.common.CommonMiddleware", - "django.middleware.csrf.CsrfViewMiddleware", - "django.contrib.auth.middleware.AuthenticationMiddleware", - "django.contrib.messages.middleware.MessageMiddleware", - "django.middleware.clickjacking.XFrameOptionsMiddleware", + 'nlotp.middleware.OTPCheckMiddleware', + ] + +3. Add `nlotp` urls to `urls.py`. For example: - "nlotp.middleware.OTPCheckMiddleware", -] - -``` + urlpatterns = [ + path('otp/', include('nlotp.urls', namespace='nlotp')), + path('', include('yourapp.urls', namespace='yourapp')), + ] ## Settings