MicroPyramid/django-mfa

After I upgraded to 1.1 im facing template rendering error

GuganVignesh opened this issue · 3 comments

Hi team (@chaitu210 @gregkster ),

I have just upgraded the django-mfa and tested it without making any change, I am facing the following error when I click 'Setup using an app' button in the configuration window. Can you please help me with it !

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/settings/mfa/configure/

Django Version: 1.10.5
Python Version: 2.7.10
Installed Applications:
['angeekaram.apps.AngeekaramConfig',
 'vasool_raja_mbbs.apps.VasoolRajaMbbsConfig',
 'maya_bazaar.apps.MayaBazaarConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_countries',
 'django_extensions',
 'django_mfa',
 'django_user_agents']
Installed 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',
 'django_mfa.middleware.MfaMiddleware',
 'django_user_agents.middleware.UserAgentMiddleware']


Template error:
In template /Users/guganvigneshs/Dropbox/WORK_SPACE/PROJECT-COLORS/colors/templates/django_mfa/configure.html, error at line 35
   Reverse for 'enable_mfa' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []   25 :                             <div class="simple-box-footer">
   26 :                             Scan the image above with the two-factor authentication app on your phone.
   27 :                             </div>
   28 :                         </div>
   29 :                         <p>
   30 :                             After scanning the barcode image, the app will display a six-digit code that
   31 :                             you can enter below.
   32 :                         </p>
   33 :                         <hr>
   34 :                         <!-- </textarea> --><!-- '"` -->
   35 :                         <form accept-charset="UTF-8" action=" {% url 'mfa:enable_mfa' %} " method="post">
   36 :                             {% csrf_token %}
   37 :                             <dl class="form-group">
   38 :                                 <dt>
   39 :                                     <label for="two-factor-code">
   40 :                                         <h3 class="simple-box-title">
   41 :                                         2. Enter the six-digit code from the application
   42 :                                         </h3>
   43 :                                     </label>
   44 :                                 </dt>
   45 :                                 <dd>


Traceback:

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django_mfa/views.py" in configure_mfa
  42.     return render(request, 'django_mfa/configure.html', {"qr_code": qr_code, "secret_key": base_32_secret_utf8})

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/shortcuts.py" in render
  30.     content = loader.render_to_string(template_name, context, request, using=using)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  68.     return template.render(context, request)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/backends/django.py" in render
  66.             return self.template.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  208.                     return self._render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  174.         return compiled_parent._render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  174.         return compiled_parent._render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  70.                 result = block.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  315.                 return nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  70.                 result = block.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  315.                 return nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  315.                 return nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  439.             url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/urls/base.py" in reverse
  91.     return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/urls/resolvers.py" in _reverse_with_prefix
  392.             (lookup_view_s, args, kwargs, len(patterns), patterns)

Exception Type: NoReverseMatch at /settings/mfa/configure/
Exception Value: Reverse for 'enable_mfa' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

screen shot 2018-09-27 at 5 21 27 pm

screen shot 2018-09-27 at 5 21 11 pm

Hi team,

I have just upgraded the django-mfa and tested it without making any change, I am facing the following error when I click 'Setup using an app' button in the configuration window. Can you please help me with it !

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/settings/mfa/configure/

Django Version: 1.10.5
Python Version: 2.7.10
Installed Applications:
['angeekaram.apps.AngeekaramConfig',
 'vasool_raja_mbbs.apps.VasoolRajaMbbsConfig',
 'maya_bazaar.apps.MayaBazaarConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_countries',
 'django_extensions',
 'django_mfa',
 'django_user_agents']
Installed 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',
 'django_mfa.middleware.MfaMiddleware',
 'django_user_agents.middleware.UserAgentMiddleware']


Template error:
In template /Users/guganvigneshs/Dropbox/WORK_SPACE/PROJECT-COLORS/colors/templates/django_mfa/configure.html, error at line 35
   Reverse for 'enable_mfa' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []   25 :                             <div class="simple-box-footer">
   26 :                             Scan the image above with the two-factor authentication app on your phone.
   27 :                             </div>
   28 :                         </div>
   29 :                         <p>
   30 :                             After scanning the barcode image, the app will display a six-digit code that
   31 :                             you can enter below.
   32 :                         </p>
   33 :                         <hr>
   34 :                         <!-- </textarea> --><!-- '"` -->
   35 :                         <form accept-charset="UTF-8" action=" {% url 'mfa:enable_mfa' %} " method="post">
   36 :                             {% csrf_token %}
   37 :                             <dl class="form-group">
   38 :                                 <dt>
   39 :                                     <label for="two-factor-code">
   40 :                                         <h3 class="simple-box-title">
   41 :                                         2. Enter the six-digit code from the application
   42 :                                         </h3>
   43 :                                     </label>
   44 :                                 </dt>
   45 :                                 <dd>


Traceback:

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django_mfa/views.py" in configure_mfa
  42.     return render(request, 'django_mfa/configure.html', {"qr_code": qr_code, "secret_key": base_32_secret_utf8})

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/shortcuts.py" in render
  30.     content = loader.render_to_string(template_name, context, request, using=using)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  68.     return template.render(context, request)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/backends/django.py" in render
  66.             return self.template.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  208.                     return self._render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  174.         return compiled_parent._render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  174.         return compiled_parent._render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  70.                 result = block.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  315.                 return nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  70.                 result = block.nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  315.                 return nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  315.                 return nodelist.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render
  994.                 bit = node.render_annotated(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  961.             return self.render(context)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  439.             url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/urls/base.py" in reverse
  91.     return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))

File "/Users/guganvigneshs/colors/lib/python2.7/site-packages/django/urls/resolvers.py" in _reverse_with_prefix
  392.             (lookup_view_s, args, kwargs, len(patterns), patterns)

Exception Type: NoReverseMatch at /settings/mfa/configure/
Exception Value: Reverse for 'enable_mfa' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
screen shot 2018-09-27 at 5 21 27 pm screen shot 2018-09-27 at 5 21 11 pm

@chaitu210 @gregkster can you please look into this !

Fixed by removing the namespace = 'mfa' in urls.py