Hey everyone--
I've got a predominantly static site that I need to serve through
Django, at least until I can convert more of it over properly. Yes, I
know this is discouraged, but it's the only way I'm going to be able
to move forward w/this project....
I cribbed this line:
urlpatterns += patterns('django.views.generic.simple',
(r'(?P<template>.*)', 'direct_to_template'),
)
...from here: http://www.djangosnippets.org/snippets/346/
...and it works hunky-dory for most everything-- however, it doesn't
catch assumed index pages (going to http://www.mysite.com gives a
"template doesn't exist" error; going to http://www.mysite.com/index.html
works fine....)
Further down that "snippets" page someone posted the following:
* (r'^(.*)/$', lambda request, path: direct_to_template(request,
"%s/index.html" % (path,))),
* (r'^(?P.*)$', direct_to_template),
...but I've had no luck w/either of those.
Anyone had any experience w/this? I'd really like to establish a
catch-all-- very specific Django-pages defined first in my urls.py,
then everything else passes cleanly through to the static site as it
stands, w/indexes working correctly-- and clearly, I'm really not too
sure what the heck I'm doing, esp. when one of those damn "lambda"'s
rears their ugly heads--
Any & all help most appreciated!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---