Re: [web2py] Routes help for wordpress style urls

2011-12-24 Thread Anthony
> > Not sure the below is a problem with routes or not. > I have a feed() function. If I browse to feed.rss it works fine. But I > would like /feed/ as the url (without.rss). How to achieve it? > You could do that with the pattern-based rewrite system, but then you wouldn't be able to use the p

Re: [web2py] Routes help for wordpress style urls

2011-12-24 Thread Joseph Jude
Hopefully last question on this thread. routers = dict( init= dict(functions = ['index', 'user', 'contact', 'sitemap', 'feed', 'error']), ) above works for admin, appadmin & for other entries too Not sure the below is a problem with routes or not. I have a feed() function. If I browse

Re: [web2py] Routes help for wordpress style urls

2011-12-23 Thread Anthony
On Friday, December 23, 2011 12:14:32 PM UTC-5, Joseph Jude wrote: > > routers = dict( > BASE = dict(default_application = 'init', > default_controller = 'default', > default_function = 'index', > functions = ['index'], > ), > ) > > With the above routes, admin doesn't work. i.e: localhost:8080/a

Re: [web2py] Routes help for wordpress style urls

2011-12-23 Thread Jonathan Lundell
On Dec 23, 2011, at 9:14 AM, Joseph Jude wrote: > routers = dict( > BASE= dict(default_application = 'init', > default_controller = 'default', > default_function = 'index', > functions = ['index'], > ), > ) > > With the above routes, admin doesn

Re: [web2py] Routes help for wordpress style urls

2011-12-23 Thread Joseph Jude
routers = dict( BASE = dict(default_application = 'init', default_controller = 'default', default_function = 'index', functions = ['index'], ), ) With the above routes, admin doesn't work. i.e: localhost:8080/admin/index throws a password pg but after that the control goes to /admin/site and it

Re: [web2py] Routes help for wordpress style urls

2011-12-23 Thread Jonathan Lundell
On Dec 23, 2011, at 6:04 AM, Anthony wrote: > No. The problem is that the router doesn't introspect the controller, and it > doesn't know what its function names are. So it assumes that 2011 is a > function in the default controller. > > For this to work, it's necessary to provide the router wi

Re: [web2py] Routes help for wordpress style urls

2011-12-23 Thread Anthony
> > No. The problem is that the router doesn't introspect the controller, and > it doesn't know what its function names are. So it assumes that 2011 is a > function in the default controller. > > For this to work, it's necessary to provide the router with a list of > valid functions in the defa

Re: [web2py] Routes help for wordpress style urls

2011-12-22 Thread Joseph Jude
Thx Jonathan & Anthony. Following works: routers = dict( BASE = dict(default_application = 'init', default_controller = 'default', default_function = 'index', functions = ['index'], ), ) Regards, Joseph

Re: [web2py] Routes help for wordpress style urls

2011-12-22 Thread Jonathan Lundell
On Dec 22, 2011, at 9:21 PM, Anthony wrote: > On Thursday, December 22, 2011 9:09:22 PM UTC-5, Joseph Jude wrote: > I used this the below in routes.in > > (r'^(?P\d{4})/(?P\d{2})/(?P\w+)/$', > '/init/default/index/\g/\g'), > > but when I go to a url > > localhost:/2011/11/a-slug > > it return

Re: [web2py] Routes help for wordpress style urls

2011-12-22 Thread Anthony
On Thursday, December 22, 2011 9:09:22 PM UTC-5, Joseph Jude wrote: > > I used this the below in routes.in > > (r'^(?P\d{4})/(?P\d{2})/(?P\w+)/$', > '/init/default/index/\g/\g'), > > but when I go to a url > > localhost:/2011/11/a-slug > > it returns invalid request error > > then I tried > > rou

Re: [web2py] Routes help for wordpress style urls

2011-12-22 Thread Joseph Jude
yes anthony

Re: [web2py] Routes help for wordpress style urls

2011-12-22 Thread Anthony
Is your application named 'init'? On Thursday, December 22, 2011 9:09:22 PM UTC-5, Joseph Jude wrote: > > I used this the below in routes.in > > (r'^(?P\d{4})/(?P\d{2})/(?P\w+)/$', > '/init/default/index/\g/\g'), > > but when I go to a url > > localhost:/2011/11/a-slug > > it returns invalid requ

Re: [web2py] Routes help for wordpress style urls

2011-12-22 Thread Joseph Jude
I used this the below in routes.in (r'^(?P\d{4})/(?P\d{2})/(?P\w+)/$', '/init/default/index/\g/\g'), but when I go to a url localhost:/2011/11/a-slug it returns invalid request error then I tried routers = dict( BASE = dict(default_application = 'init', default_controller = 'default',

Re: [web2py] Routes help for wordpress style urls

2011-12-22 Thread Jonathan Lundell
On Dec 22, 2011, at 9:03 AM, Joseph Jude wrote: > I am almost complete on a blog engine for myself and have also written import > from wordpress. I'm not stuck at mapping the urls. In wordpress I've been > using > > domain//mm/slug > > as url for posts and > > domain/page > > for pages.