I'm only going to answer this one because it's easy: regular
expressions. Before I elaborate, though, a word of advice: this is /not/
a good idea. Not as you formulate it, at least. Do not make them point
to the same class; make them /redirect/ to the right class. This way
there will be no two pages with exactly the same content on your website
(this confuses bots and many other tools; for example, a browser will
not remember going to the page without a / so will not colour it
purple-or-whatever, which might confuse the visitor; "huh, didn't I
already go there?" etcetera etcetera). No, I am not making this up:
google will kill you if you do so (it is not considered a good thing if
you have bogus content, and duplicate content is bogus in their eyes).
If not google then other search engines.
Anyway.
Make a regexp that grabs any page without trailing slash, optionally
checks if there is an entry with slash defined in the urls list and
redirects the user (301).
> Btw why if Import myapp and put myapp.views.MyClass in the urls it
> doesn't work ? I have to do "from myapp.views import MyClass" and then
> put MyClass in urls to have it working. Any idee ?
>
> Maybe because I use globals() but how to replace it ?
>
>
> many questions for know, juste started to play with webpy ;)
>
>
> - benoît
Hope this answers your question.
b^4
add the following to the beginning of urls.
"/(.*)/", "redirect",
and have the following class to handle those urls.
class redirect:
def GET(self, path):
web.seeother('/' + path)