Learning django & python.
Just set up a new site after doing the tutorial. Now for arguments sake say I want to add a bunch of About us, FAQ basic html pages with ve
One way to do this would be to write a single custom view that wraps the direct_to_template
generic view. The wrapper could accept a parameter and accordingly form the name of the template and pass it to direct_to_template
. This way you can route multiple pages with a single URL configuration.
Something like this:
url(r'^foo/(?P\w+).html$', 'my_static_wrapper', name = 'my_static_wrapper'),
def my_static_wrapper(request, page_name):
# form template name and call direct_to_template
That said I suspect that there are better solutions out there though.