The routes.example.py contains some unit tests. I have found this to be the most effective way of testing my routes to make sure they do what I want.
-- Thadeus On Sun, Aug 8, 2010 at 7:30 PM, Jonathan Lundell <jlund...@pobox.com> wrote: > On Aug 8, 2010, at 5:10 PM, Andrew Thompson wrote: > >> I can not wrap my head around routes_in. I'm attempting to host 3 sites via >> lighttpd and fcgihandler.py (is this the best way?) >> >> I ripped this mostly from a mdpierro post, and tweaked it for my domain, but >> I'm just not making progress: >> >> ('(.*):https?://(.*)mysite\.com:(.*) /favicon.ico', >> '/mysite/static/favicon.ico'), >> >> http://mysite.com/mysite/static/favicon.ico <-- this link works. >> http://myste.com/favicon.ico <-- Invalid request > > You meant 'mysite', right? > >> >> I've been playing with the builtin doctest, and this passes: >> >> >>> filter_url('http://mysite.com/favicon.ico') >> 'http://mysite.com/mysite/static/favicon.ico' >> >> Any ideas what I'm doing wrong? > > You're restarting web2py when you change routes.py? > > I think it'd be useful to be able to turn on logging of URL rewriting. It'd > be pretty verbose, I suppose, but useful for this kind of problem. > >> >> I have two more lines commented out that I also want to put in: >> >> ('(.*):https?://(.*)mysite\.com:(.*) /$anything', '/mysite/$anything'), >> ('(.*):https?://(.*)mysite\.com:(.*) /images/$anything', >> '/mysite/static/images/$anything'), >> >> I'm not sure, is $anything is compatible with all those .*'es? > > I think so. No need to parenthesize them, since there's no capture going on. > I might use .*? instead. But .* should work in this case. > >> >> I do need the / to /mysite's to keep the sites separated from each other, >> don't I? > > I don't follow the question. > >> >> Any help appreciated. >> >> -- >> Andrew Thompson >> http://aktzero.com/ >> > > >