Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created October 6, 2013 19:56
Show Gist options
  • Save groovecoder/6858385 to your computer and use it in GitHub Desktop.
Save groovecoder/6858385 to your computer and use it in GitHub Desktop.
from django.views.generic.simple import direct_to_template
direct_templates = ['about', 'news']
for template in direct_templates:
urlpatterns = patterns('', (r'^%s/?$' % template), direct_to_template,
{'template': '%s.html' % template})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment