Hi
I'm currently trying to change a bit what my url look like.
I currently have url like :
http://www.naphtaline.net/projects/some_name/bug/10
http://www.naphtaline.net/logMeIn/some_name/bug/10
Which works very fine. But for various reasons,I'd like to use url
like that :
http://projects.naphtaline.net/some_name/bug/10
http://projects.naphtaline.net/some_name/logMeIn/bug/10
which would allow the user to find all the pages related to his own
project at
http://projects.naphtaline.net/some_name
I was using that code :
d.connect('logMeIn', '/logMeIn/:project/:category/:idEntry',
controller=root, action='logMeIn', category='bug', idEntry=0)
d.connect('projects', '/projects/:project/:category/:idEntry',
controller=root, action='projects', category='bug', idEntry=0)
And I changed it for that :
d.connect('logMeIn', '/:project/logMeIn/:category/:idEntry',
controller=root, action='logMeIn', category='bug', idEntry=0)
d.connect('projects', '/:project/:category/:idEntry', controller=root,
action='projects', category='bug', idEntry=0)
The issue is that I could potentially have a project called "logMeIn"
and therefore there may be a conflict.
I went to #pylons to talk about Routes and they told me there should
be no issue since routes stops at the first url matched. I just have
to be careful about the order of the entries.
However, when I try the new code, I get this error from cherrypy, and
it does not want to start.
Traceback (most recent call last):
File "naphtaline.py", line 1699, in ?
cherrypy.engine.start()
File "/var/lib/python-support/python2.4/cherrypy/_cpengine.py", line
77, in start
cherrypy.checker()
File "/var/lib/python-support/python2.4/cherrypy/_cpchecker.py",
line 24, in __call__
method()
File "/var/lib/python-support/python2.4/cherrypy/_cpchecker.py",
line 55, in check_static_paths
request.get_resource(section + "/dummy.html")
File "/var/lib/python-support/python2.4/cherrypy/_cprequest.py",
line 628, in get_resource
dispatch(path)
File "/var/lib/python-support/python2.4/cherrypy/_cpdispatch.py",
line 253, in __call__
func = self.find_handler(path_info)
File "/var/lib/python-support/python2.4/cherrypy/_cpdispatch.py",
line 274, in find_handler
result = self.mapper.match(path_info)
File "/usr/lib/python2.4/site-packages/Routes-1.8-py2.4.egg/routes/
base.py", line 826, in match
result = self._match(url)
File "/usr/lib/python2.4/site-packages/Routes-1.8-py2.4.egg/routes/
base.py", line 805, in _match
self.sub_domains_ignore, self.domain_match)
File "/usr/lib/python2.4/site-packages/Routes-1.8-py2.4.egg/routes/
base.py", line 409, in match
if environ.get('HTTP_HOST') and sub_domains:
File "/var/lib/python-support/python2.4/cherrypy/_cpdispatch.py",
line 224, in __getattr__
return getattr(cherrypy.request.wsgi_environ, key)
File "/var/lib/python-support/python2.4/cherrypy/__init__.py", line
235, in __getattr__
return getattr(child, name)
AttributeError: 'Request' object has no attribute 'wsgi_environ'
Any idea ?