Quickly check templates while sketching them out
This a small but very handy view that gives you a convenient direct access to your templates. Now suppose you saved the snippet under `misc.py`, it's critical to add this snippet (or a similar one, once you get the idea) to your `urls.py`: if settings.DEBUG: # Direct Templates urlpatterns += patterns('misc', (r'^template/(?P<path>.*)$', 'direct_to_template', {'template': '%(path)s'}), ) Now you are able to access any of your templates, in different directories by specifying their path after `template/`. e.g., http://example.com/template/news/index.html Of course you can change it as you want, you can also add other values to the dict argument, the only required key is `'template'`. The whole dict is made available in the template as a context. All GET parameters are made available in the template too. So `http://example.com/template/news/index.html?title=Testing Title` will make the `{{ title }}` var available in your template. So you can substitute basic variables quickly. This is was inspired by [django.views.generic.simple.direct_to_template](http://www.djangoproject.com/documentation/generic_views/#django-views-generic-simple-direct-to-template)
- template
- view
- generic