Hi everyone, Coming from Rails, I've been naming my templates according to their corresponding URLs. But, since Django's routing is RegEx based, I'm sure there's a better way to do this:
urlpatterns = patterns('', (r'^$', direct_to_template, {'template':'home.html'}), (r'^contact/$', direct_to_template, {'template':'contact.html'}), ) urlpatterns += patterns('compliance-bsa/', (r'compliance-audits/$', direct_to_template, {'template':'compliance-audits.html'}), (r'bsa-audits/$', direct_to_template, {'template':'bsa-audits.html'}), (r'compliance-officer/$', direct_to_template, {'template':'compliance-officer.html'}), (r'fair-lending-reviews/$', direct_to_template, {'template':'fair-lending-reviews.html'}), ) So, I tried replacing the patterns in the 'compliance-bsa' patterns with: (r'?P<template>[-\w]+/$', direct_to_template, {'template' : '% (template)s.html'}), ...and received an error saying: Error while importing URLconf 'rdk.pages.urls': nothing to repeat Advice appreciated! Brandon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---