Created
July 5, 2010 15:31
-
-
Save benspaulding/464466 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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