# HG changeset patch # User Gustavo Andres Morero # Date 1597355708 10800 # Thu Aug 13 18:55:08 2020 -0300 # Node ID 56af72bb9fb4ad83ed9239338e496b4821eeeef0 # Parent 0cf38c9d3dcc4dbfaec1f8a3e1f1dc9765d3be74 back to python code highlight on README.md diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -9,42 +9,48 @@ ## Installation -1. Add `django_otp`, `django_otp.plugins.otp_totp`, `django_otp.plugins.otp_static` and `nlotp` to `INSTALLED_APPS`. For example: +* 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', +```python + 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', - ] + '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: +* Add `nlotp.middleware.OTPCheckMiddleware` to `MIDDLEWARE`. It must be installed after `django.contrib.auth.middleware.AuthenticationMiddleware`. For example: - 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', +```python + 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', - ] + 'nlotp.middleware.OTPCheckMiddleware', + ] +``` -3. Add `nlotp` urls to `urls.py`. For example: +* Add `nlotp` urls to `urls.py`. For example: - urlpatterns = [ - path('otp/', include('nlotp.urls', namespace='nlotp')), - path('', include('yourapp.urls', namespace='yourapp')), - ] +```python + urlpatterns = [ + path('otp/', include('nlotp.urls', namespace='nlotp')), + path('', include('yourapp.urls', namespace='yourapp')), + ] +``` ## Settings