Skip to content

Instantly share code, notes, and snippets.

@benspaulding
Created July 5, 2010 15:31
Show Gist options
  • Save benspaulding/464466 to your computer and use it in GitHub Desktop.
Save benspaulding/464466 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Logic block test</title>
<h1>Logic block test</h1>
<p>It appears to me that template tags within “skipped” logic blocks are
actually evaluated. The code below throws an error when the either of the
<code>load</code> or <code>firstof</code> statements is uncommented.
<dl>
<dt>Foobar
<dd>{{ foobar|yesno }}
</dl>
<p>
{% if foobar %}
{# {% load foobar %} #}
{# {% firstof %} #}
We have <code>foobar</code>!
{% else %}
There is no <code>foobar</code>.
{% endif %}
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'$', 'django.views.generic.simple.direct_to_template',
{ 'template': 'homepage.html' }),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment