gc2gh / django-newsroom

Automatically exported from code.google.com/p/django-newsroom
Other
0 stars 0 forks source link

media_insert causes TemplateSyntaxError when media is not found #33

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Not sure if this is intended behavior, should probably just print "Not
Found" or something.  Lemme know.

Here's the stacktrace:

Environment:

Request Method: GET
Request URL: http://localhost:8000/videos/video/1/bear-rock-video/
Django Version: 1.1 alpha 1 SVN-10093
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.admindocs',
 'core',
 'aggregator',
 'features',
 'stories',
 'countries',
 'profiles',
 'photologue',
 'tagging',
 'registration',
 'my_profiles',
 'multimedia',
 'videos',
 'sections',
 'utils']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')

Template error:
In template
/Users/mandric/dev/django-newsroom/working/trunk/newsroom/templates/videos/video
_detail.html,
error at line 19
   Invalid block tag: 'media_insert'
   9 : <link rel="alternate" type="application/rss+xml" title="RSS 2.0" 

   10 :       href="http://{{ site.domain }}/rss/videos/" />

   11 : <link rel="alternate" type="application/atom+xml" title="Atom 1.0" 

   12 :       href="http://{{ site.domain }}/atom/videos/" />

   13 : {% endblock %}

   14 : 

   15 : {% block content %}

   16 : <h1>{{ object }}</h1>

   17 : 

   18 : 

   19 :  {% media_insert {{object.id}} %} 

   20 : 

   21 : <div class="video_meta">

   22 : <h2>Download</h2>

   23 : <p class="file">

   24 : {% if object.video %}<p>{% trans "Video File" %}: <a
href="{{MEDIA_URL}}{{ object.video }}">{{ object.video }}</a></p>{% endif %}

   25 : 

   26 : <h2>Meta</h2>

   27 : <p class="byline">{% trans "Posted by" %} 

   28 : {{ object.authors.all|join:", " }}

   29 : </p>

Traceback:
File "/Library/Python/2.5/site-packages/django/core/handlers/base.py" in
get_response
  92.                 response = callback(request, *callback_args,
**callback_kwargs)
File "./apps/videos/views.py" in video_detail
  41.                 context_instance=RequestContext(request))
File "/Library/Python/2.5/site-packages/django/shortcuts/__init__.py" in
render_to_response
  18.     return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)
File "/Library/Python/2.5/site-packages/django/template/loader.py" in
render_to_string
  103.         t = get_template(template_name)
File "/Library/Python/2.5/site-packages/django/template/loader.py" in
get_template
  82.     template = get_template_from_string(source, origin, template_name)
File "/Library/Python/2.5/site-packages/django/template/loader.py" in
get_template_from_string
  90.     return Template(source, origin, name)
File "/Library/Python/2.5/site-packages/django/template/__init__.py" in
__init__
  167.         self.nodelist = compile_string(template_string, origin)
File "/Library/Python/2.5/site-packages/django/template/__init__.py" in
compile_string
  188.     return parser.parse()
File "/Library/Python/2.5/site-packages/django/template/__init__.py" in parse
  284.                     compiled_result = compile_func(self, token)
File "/Library/Python/2.5/site-packages/django/template/loader_tags.py" in
do_extends
  169.     nodelist = parser.parse()
File "/Library/Python/2.5/site-packages/django/template/__init__.py" in parse
  284.                     compiled_result = compile_func(self, token)
File "/Library/Python/2.5/site-packages/django/template/loader_tags.py" in
do_block
  147.     nodelist = parser.parse(('endblock', 'endblock %s' % block_name))
File "/Library/Python/2.5/site-packages/django/template/__init__.py" in parse
  282.                     self.invalid_block_tag(token, command)
File "/Library/Python/2.5/site-packages/django/template/__init__.py" in
invalid_block_tag
  334.         raise self.error(token, "Invalid block tag: '%s'" % command)

Exception Type: TemplateSyntaxError at /videos/video/1/bear-rock-video/
Exception Value: Invalid block tag: 'media_insert'

Original issue reported on code.google.com by mand...@gmail.com on 9 Apr 2009 at 2:13

GoogleCodeExporter commented 8 years ago

Original comment by jgty...@gmail.com on 14 Apr 2009 at 1:17