iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.65k stars 306 forks source link

django.template.exceptions.TemplateSyntaxError: 'account_tags' is not a registered tag library #136

Open horlahlekhon opened 4 years ago

horlahlekhon commented 4 years ago

Hi, am getting this error while trying out the registration endpoint, seems a template tag is not registered or so, kindly assist, Thanks much.

installed apps

[
'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_extensions',
    'django.contrib.sites',
    'rest_framework',
"pinax.templates",
    "pinax.notifications",
    'dj_rest_auth',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'dj_rest_auth.registration',
]

django-allauth version == 0.42.0 dj-rest-auth version = 1.1.1 django == 3.0.4

stack trace:

Traceback (most recent call last):                                                                                                                                                                                                                                              
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__                                                                                                                             
    return self.application(environ, start_response)                                                                                                                                                                                                                            
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/sentry_sdk/integrations/django/__init__.py", line 118, in sentry_patched_wsgi_handler                                                                                                     
    return SentryWsgiMiddleware(bound_old_app)(environ, start_response)                                                                                                                                                                                                         
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/sentry_sdk/integrations/wsgi.py", line 129, in __call__                                                                                                                                   
    reraise(*_capture_exception(hub))                                                                                                                                                                                                                                           
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/sentry_sdk/_compat.py", line 57, in reraise                                                                                                                                               
    raise value                                                                                                                                                                                                                                                                 
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/sentry_sdk/integrations/wsgi.py", line 122, in __call__                                                                                                                                   
    rv = self.app(                                                                                                                                                                                                                                                              
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 133, in __call__                                                                                                                                      
    response = self.get_response(request)                                                                                                                                                                                                                                       
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/sentry_sdk/integrations/django/__init__.py", line 152, in sentry_patched_get_response                                                                                                     
    return old_get_response(self, request)                                                                                                                                                                                                                                      
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/base.py", line 75, in get_response                                                                                                                                   
    response = self._middleware_chain(request)                                                                                                                                                                                                                                  
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 36, in inner                                                                                                                                     
    response = response_for_exception(request, exc)                                                                                                                                                                                                                             
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception                                                                                                                    
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())                                                                                                                                                                                  
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception                                                                                                                
    return debug.technical_500_response(request, *exc_info)                                                                                                                                                                                                                     
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response                                                                                              
    six.reraise(exc_type, exc_value, tb)                                                                                                                                                                                                                                        
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/six.py", line 695, in reraise                                                                                                                                                             
    raise value.with_traceback(tb)                                                                                                                                                                                                                                              
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner                                                                                                                                     
    response = get_response(request)                                                                                                                                                                                                                                            
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response                                                                                                                                 
    response = self.process_exception_by_middleware(e, request)                                                                                                                                                                                                                 
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response                                                                                                                                 
    response = wrapped_callback(request, *callback_args, **callback_kwargs)                                                                                                                                                                                                     
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view                                                                                                                                
    return view_func(*args, **kwargs)                                                                                                                                                                                                                                           
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/views/generic/base.py", line 71, in view                                                                                                                                           
    return self.dispatch(request, *args, **kwargs)                                                                                                                                                                                                                              
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/utils/decorators.py", line 43, in _wrapper                                                                                                                                         
    return bound_method(*args, **kwargs)                                                                                                                                                                                                                                        
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper                                                                                                          
    return view(request, *args, **kwargs)                                                                                                                                                                                                                                       
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/dj_rest_auth/registration/views.py", line 43, in dispatch                                                                                                                                 
    return super(RegisterView, self).dispatch(*args, **kwargs)                                                                                                                                                                                                                  
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/rest_framework/views.py", line 505, in dispatch                                                                                                                                           
    response = self.handle_exception(exc)                                                                                                                                                                                                                                       
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/rest_framework/views.py", line 465, in handle_exception                                                                                                                                   
    self.raise_uncaught_exception(exc)                                                                                                                                                                                                                                          
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception  

File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/rest_framework/generics.py", line 190, in post
    return self.create(request, *args, **kwargs)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/dj_rest_auth/registration/views.py", line 63, in create
    user = self.perform_create(serializer)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/dj_rest_auth/registration/views.py", line 79, in perform_create
    complete_signup(self.request._request, user,
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/utils.py", line 188, in complete_signup
    return perform_login(request, user,
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/utils.py", line 152, in perform_login
    send_email_confirmation(request, user, signup=signup)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/utils.py", line 322, in send_email_confirmation
    email_address.send_confirmation(request,
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/models.py", line 58, in send_confirmation
    confirmation.send(request, signup=signup)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/models.py", line 163, in send
    get_adapter(request).send_confirmation_mail(request, self, signup)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/adapter.py", line 453, in send_confirmation_mail
    self.send_mail(email_template,
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/adapter.py", line 136, in send_mail
    msg = self.render_mail(template_prefix, email, context)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/allauth/account/adapter.py", line 114, in render_mail
    bodies[ext] = render_to_string(template_name,
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 171, in render
    return self._render(context)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 936, in render
    bit = node.render_annotated(context)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 903, in render_annotated
    return self.render(context)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/loader_tags.py", line 176, in render
    template = context.template.engine.get_template(template_name)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/engine.py", line 143, in get_template
    template, origin = self.find_template(template_name)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/engine.py", line 125, in find_template
    template = loader.get_template(name, skip=skip)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/loaders/base.py", line 29, in get_template
    return Template(
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 156, in __init__
    self.nodelist = self.compile_nodelist()
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 194, in compile_nodelist
    return parser.parse()
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 477, in parse
    raise self.error(token, e)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/base.py", line 475, in parse
    compiled_result = compile_func(self, token)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/defaulttags.py", line 1078, in load
    lib = find_library(parser, name)
  File "/Users/mac/workspace/personal_projects/growth_env/lib/python3.8/site-packages/django/template/defaulttags.py", line 1023, in find_library
    raise TemplateSyntaxError(
django.template.exceptions.TemplateSyntaxError: 'account_tags' is not a registered tag library. Must be one of:
account
admin_list
admin_modify
admin_urls
bootstrap
cache
debugger_tags
highlighting
i18n
indent_text
l10n
log
raven
request_id
rest_framework
socialaccount
static
syntax_color
truncate_letters
tz
widont

thanks for assistance.

iMerica commented 4 years ago

This package doesn't include templates. It sounds like your all-auth registration templates might have an error.

horlahlekhon commented 4 years ago

all-auth is used by dj-rest-auth and it doesn't say in the docs that one needs to provide any template, so I didn't provide any. i just followed the steps and run the registration endpoint and got this. do I need to provide template