Now, I try use Routes, but in this not working regular expression :-(
## code begin
import cherrypy
from context import Index
from context import Page2
from context import Page3
d = cherrypy.dispatch.RoutesDispatcher()
m = d.mapper
m.explicit = True
m.minimization = False
d.connect('index', '/', controller=Index.Index(), action='index')
d.connect('pg2', r'/pg2-(\d+)-(.*)/$', controller=Page2.Page2(),
action='index') # url example:
http://myserver/pg2-1234-astalavista/
d.connect('pg2_edit', r'/pg2-edit-(\d+)-(.*)/$',
controller=Page2.Edit(), action='index') # url example:
http://myserver/pg2-edit-54-astalavista/
d.connect('pg3', '/pg3/$', controller=Page3.Edit(), action='index')
conf = {'/' : {'request.dispatch' : d}}
cherrypy.tree.mount(root=None, config=conf)
cherrypy.engine.start()
## code end
URLs "/" and "/pg3/" works correctly, but URLs with regular expression
not working (I get 404 Not Found), why?
Any idea ?
Tomas
Dne 8.12.2009 11:57, Tomas Brabenec napsal(a):