New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnknownBackendException in template #18

Closed
yetty opened this Issue Feb 22, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@yetty
Collaborator

yetty commented Feb 22, 2014

Malek Yala wrote:

Hey troubles with django-embed-video

It works very well when I want to have a video but when I leave the urlfield blank I get an UnknownBackenExeption error. I have added blank=True, tried Null=True, required=false, but my blog model doesn't seem allow me to NOT have an embed.

Please Help,
Malek

Environment:


Request Method: GET
Request URL: ****

Django Version: 1.6.2
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'filebrowser',
 'django.contrib.admin',
 'south',
 'taggit',
 'file_picker',
 'file_picker.uploads',
 'file_picker.wymeditor',
 'bootstrap_toolkit',
 'social_poster',
 'imagekit',
 'collage',
 'PIL',
 'markdown',
 'photologue',
 'django_evolution',
 'admin_honeypot',
 'dbbackup',
 's3_folder_storage',
 'disqus',
 'django_social_share',
 'django_bitly',
 'taggit_templatetags',
 'easy_thumbnails',
 'optimizations',
 'responsive_images',
 'embed_video',
 'filebrowser',
 'tinymce',
 'blog',
 'gallery',
 'home',
 'contact',
 'debug_toolbar')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware')


Template error:
In template /www/mysite/mysite/templates/blog.html, error at line 33
   (Could not get exception message)
   23 :                         <p class="p2">{{blog.perex|safe}}</p>    


   24 :                             <div class="row">


   25 :                             


   26 : 


   27 : 


   28 : 


   29 : 


   30 : 


   31 : 


   32 : 


   33 :      {% video blog.embed "420x300" %} 


   34 :                                                                                                              </div>


   35 : <p class="p2">{{blog.content|safe}}</p>


   36 :   <div class="row">


   37 : 


   38 : 


   39 :     


   40 :     </div>


   41 :         {% include "share.html" %}


   42 : 


   43 : 


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  139.                 response = response.render()
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in render
  105.             self.content = self.rendered_content
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in rendered_content
  82.         content = template.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/test/utils.py" in instrumented_test_render
  85.     return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/test/utils.py" in instrumented_test_render
  85.     return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  62.             result = block.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/usr/local/lib/python2.7/dist-packages/embed_video/templatetags/embed_video_tags.py" in render
  71.             return self.__render_embed(url, context)
File "/usr/local/lib/python2.7/dist-packages/embed_video/templatetags/embed_video_tags.py" in __render_embed
  77.         return self.embed(url, size, context=context)
File "/usr/local/lib/python2.7/dist-packages/embed_video/templatetags/embed_video_tags.py" in embed
  101.         backend = VideoNode.get_backend(url, context=context)
File "/usr/local/lib/python2.7/dist-packages/embed_video/templatetags/embed_video_tags.py" in get_backend
  90.             backend = detect_backend(backend)
File "/usr/local/lib/python2.7/dist-packages/embed_video/backends.py" in detect_backend
  39.     raise UnknownBackendException

Exception Type: UnknownBackendException at /blog/tested/
Exception Value:

@yetty yetty added this to the v0.8 milestone Feb 22, 2014

@yetty

This comment has been minimized.

Collaborator

yetty commented Feb 22, 2014

Hi,

thank you for bug reporting. This issue will be fixed in next version od django-embed-video, the release is planned to the next week.

If you can't wait, there is a simple quick fix - just check if video is not empty in your templates:

{% if blog.embed %}
    {% video blog.embed "420x300" %} 
{% endif %}

I hope it'll help you.

@yetty yetty closed this in 84b2df8 Feb 22, 2014

@yetty yetty added the bug label Mar 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment