Hi,
i'm encountering some weird error in the template of my application.
The error enountered was:
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py" in get_response
100. response = callback(request,
*callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
csrf.py" in wrapped_view
23. resp = view_func(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
csrf.py" in wrapped_view
36. return view_func(*args, **kwargs)
File "/home/un0wn/mafia2/profile/views.py" in login
854. 'form' : form,
File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/
__init__.py" in render_to_response
20. return HttpResponse(loader.render_to_string(*args,
**kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/template/
loader.py" in render_to_string
186. return t.render(context_instance)
File "/usr/local/lib/python2.6/dist-packages/django/template/
__init__.py" in render
173. return self._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/
__init__.py" in _render
167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/
__init__.py" in render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py"
in render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/
defaulttags.py" in render
167. nodelist.append(node.render(context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py"
in render
89. output = self.filter_expression.resolve(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/
__init__.py" in resolve
579. new_obj = func(obj, *arg_vals)
File "/usr/local/lib/python2.6/dist-packages/django/template/
defaultfilters.py" in _dec
33. args[0] = force_unicode(args[0])
File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py"
in force_unicode
66. s = unicode(s)
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in
__unicode__
408. return self.as_widget()
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in
as_widget
446. return widget.render(name, data, attrs=attrs)
File "/usr/local/lib/python2.6/dist-packages/
django_simple_captcha-0.1.7-py2.6.egg/captcha/fields.py" in render
44. self.image_and_audio = '<img src="%s" alt="captcha"
class="captcha" />' %reverse('captcha-image',kwargs=dict(key=key))
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in reverse
350. *args, **kwargs)))
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in reverse
271. possibilities = self.reverse_dict.getlist(lookup_view)
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in _get_reverse_dict
193. self._populate()
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in _populate
173. for name in pattern.reverse_dict:
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in _get_reverse_dict
193. self._populate()
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in _populate
185. lookups.appendlist(pattern.callback, (bits,
p_pattern))
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in _get_callback
129. self._callback = get_callable(self._callback_str)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
functional.py" in wrapper
124. result = func(*args)
File "/usr/local/lib/python2.6/dist-packages/django/core/
urlresolvers.py" in get_callable
56. lookup_view = getattr(import_module(mod_name),
func_name)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
importlib.py" in import_module
35. __import__(name)
Exception Type: TemplateSyntaxError at /login
Exception Value: Caught SyntaxError while rendering: invalid syntax
(views.py, line 13)
The template i was using was just this:
{% for fields in form %}
<div>
<div class="error">{{ fields.errors }}</div>
{{ fields|escape }}<label class="required">{{
fields.label }}:
</div>
<br>
{% endfor %}
And the weird thing is that i have implemented the same code on
another server, but it works out fine. I got no idea what kind of
problem this is. Hope someone can enlighten me.
- Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.