from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template urlpatterns = patterns('', (r'^/$', direct_to_template, { 'template': 'index.html' }) )What is this 'direct_to_template' import ? It's django's built-in view, that allows us to load template without specifying any view for it. More to come soon...
Blog about programming and new technologies in general I've created for myself, to memorize briliant solutions of problems, my own parts of code written previously and some general ideas of workarounds. You can find here Python, Java, JavaScript, C++, Django, jQuery.
May 26, 2010
Generic views part 1
Problem with start page of your web app is most common: "Do I need to create view for index.html, just to allow loading the page ?". Well you don't. Take a look at the code below :
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment