[web2py] Re: tip of the day. The power of routes

2010-10-17 Thread mdipierro
I put the script in trunk under scripts/autoroutes.py to use it cp scripts/autoroutes.py routes.py then edit routes.conf as explained below: On Oct 17, 9:03 pm, mdipierro wrote: > Replace your web2py/routes.py with this: > > - begin routes.py--- > try: config=open('routes.c

[web2py] Re: tip of the day. The power of routes

2010-10-18 Thread VP
thank you. I think many of us can use this tip. Many of these tips should be archived somewhere.

[web2py] Re: tip of the day. The power of routes

2010-10-19 Thread Martin.Mulone
Great tip!. This is very usefull! and you make it in trunk :D On 17 oct, 23:03, mdipierro wrote: > Replace your web2py/routes.py with this: > > - begin routes.py--- > try: config=open('routes.conf','r').read() > except: config='' > def auto_in(apps): >     routes=[ >         (

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Can Massimo or someone clarify if this tip will result in web2py serving static files or Apache serving static files? Is this a "production" (high-performance) set up? The assumption "one domain per app" appears to suggest that this is a production set up. Yet, Massimo mentioned in an early tip s

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
This assumes web2py is serving static files. But it does not prevent you to use a apache for it. In this case you would need the virtual hosts for the different apps. On Oct 24, 1:18 pm, VP wrote: > Can Massimo or someone clarify if this tip will result in web2py > serving static files or Apache

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Massimo, Can you please show us more specifically how to do this? (I think someone also asked the same question in a previous topic). Thanks. On Oct 24, 1:25 pm, mdipierro wrote: > This assumes web2py is serving static files. But it does not prevent > you to use a apache for it. > In this cas

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
Assuming you have the routes described above and this in routes.conf - BEGIN routes.conf--- domain1.com /app1/default domain2.com /app2/default - END -- you would need this in apache config file: WSGIDaemonProcess web2py user=www-data group=www- data WSGIProcessGroup web

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Thank you Massimo. Your script as is didn't work for me (I use debian lenny). Apache complained about not recognizing virtual hosts and that there was a duplicate of the wgsi deamon (I suppose only one deamon should be named web2py). I had to modify it to make it work. (But still not desirable,

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
What works is that http://domain1.com will map to app1 as intended. What doesn't work is that app1/default/f/a/b is not mapped to f/a/b or vice versa. This is ugly. Can you show me how to get rid of "app1/default"? Thanks.

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
The messages that starts the thread explains that. I tried and it works. On Oct 24, 9:02 pm, VP wrote: > What works is thathttp://domain1.comwill map to app1 as intended. > > What doesn't work is that app1/default/f/a/b is not mapped to f/a/b or > vice versa.  This is ugly. > > Can you show me ho

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Update: if the function has no arguments, it works. I.e. http://domain.com/app/default/f gets mapped correctly to http://domain.com/f But if the function has arguments, it did not work for me. I.e http://domain.com/app/default/g/a/b does not get mapped to http://domain.com/g/a/b PS: I got

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
Aha! My mistake. $a should have been $anything everywhere in the code. I fixed is and re-posted in trunk now under scripts/autoroutes.py Massimo On Oct 24, 10:51 pm, VP wrote: > Update: > > if the function has no arguments, it works.  I.e.   > http://domain.com/app/default/f > gets mapped corr

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Great. It appears to be working as intended now. Thanks.

[web2py] Re: tip of the day. The power of routes

2014-06-22 Thread Nguyen Minh Tuan
Hi Massimo, I think there is error in your script : CURRENT line 69 : ('.*:https?://(.*\.)?%s:$method /$anything' % domain, '%s/$anything' % path) should be : ('.*:https?://(.*\.)?%s:$method /%s/$anything' % (domain, app), '/%s/$anything' % app) Regards, Tuan On Monday, October 25, 2010 11:04

[web2py] Re: tip of the day. The power of routes

2014-06-22 Thread Massimo Di Pierro
Can you post the complete correct script? thanks. On Sunday, 17 October 2010 21:03:25 UTC-5, mdipierro wrote: > > Replace your web2py/routes.py with this: > > - begin routes.py--- > try: config=open('routes.conf','r').read() > except: config='' > def auto_in(apps): > r

[web2py] Re: tip of the day. The power of routes

2014-07-01 Thread lyn2py
I don't know how I missed this, but these routes are working very well and very stable on production server. Thanks Massimo for sharing the great tip! On Monday, June 23, 2014 12:51:03 PM UTC+8, Massimo Di Pierro wrote: > > Can you post the complete correct script? thanks. > > On Sunday, 17 Oct

[web2py] Re: tip of the day. The power of routes

2014-07-03 Thread lyn2py
I have a question for anyone using this… I realized that it only works for redirects to the functions within default.py. If I setup another controller, it can't route to that controller. Is this the intended behaviour? How can I include other controllers without having to add one controller for

[web2py] Re: tip of the day. The power of routes

2014-07-03 Thread Massimo Di Pierro
There is nothing "default" specific in the script. Something else must be the problem. On Thursday, 3 July 2014 07:04:44 UTC-5, lyn2py wrote: > > I have a question for anyone using this… I realized that it only works for > redirects to the functions within default.py. If I setup another > contr

[web2py] Re: tip of the day. The power of routes

2014-07-05 Thread lyn2py
In using this routes.py, cannot have the word "admin" within the function. Not sure why that is so, but it breaks the routes and generates an "Invalid Request". This was my issue: https://groups.google.com/forum/#!topic/web2py/2GyztlR-ZYI In addition, I am unable to use more than the default.py

Re: [web2py] Re: tip of the day. The power of routes

2010-11-28 Thread Bruno Rocha
HI, I am trying to use autoroutes for the firsttime, what I want is my site running in 127.0.0.1:8080/index instead of 127.0.0.1/app/default/index. I tried the autoroutes and routes.conf explained here but i did't figure out how to make the access to static files to work. I am using web2py 1.89.5

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Johann Spies
On 29 November 2010 01:03, Bruno Rocha wrote: > HI, I am trying to use autoroutes for the firsttime, what I want is my site > running in 127.0.0.1:8080/index instead of 127.0.0.1/app/default/index. > > I tried the autoroutes and routes.conf explained here but i did't figure > out how to make the

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Bruno Rocha
Thats my working solution http://snipt.net/rochacbruno/routespy/ http://snipt.net/rochacbruno/routesconf/ -- Bruno Rocha http://about.me/rochacbruno/bio 2011/2/16 Johann Spies > > > On 29 November 2010 01:03, Bruno Rocha wrote: > >> HI, I am trying

Re: [web2py] Re: tip of the day. The power of routes

2011-02-16 Thread Johann Spies
On 16 February 2011 17:35, Bruno Rocha wrote: > Thats my working solution > > http://snipt.net/rochacbruno/routespy/ > > http://snipt.net/rochacbruno/routesconf/ > > > Thanks. It is about the same as mine. I was just wondering whether my jqgrid-problem (another thread) on my production server wa

Re: [web2py] Re: tip of the day. The power of routes

2011-02-17 Thread Bruno Rocha
jqgrig, plugin_wiki or any other plugin which has a controller can't work with this autoroutes, because in autotoures we define a default controller in this case 'default.py' is the controller. any request with ' domain.com/action' will try to find this action inside default.py, but plugin_wiki and

Re: [web2py] Re: tip of the day. The power of routes

2010-10-18 Thread Tom Atkins
Fantastic - thanks Massimo. That is extremely useful - my regex skills are pretty poor but this really helps with getting to grips with routes.py. Love the 'tips of the day' - keep 'em coming! On 18 October 2010 03:07, mdipierro wrote: > I put the script in trunk under scripts/autoroutes.py >

Re: [web2py] Re: tip of the day. The power of routes

2010-10-18 Thread Albert Abril
Wow! Thank you Massimo. Just now I was having that problem. On Mon, Oct 18, 2010 at 9:01 AM, Tom Atkins wrote: > Fantastic - thanks Massimo. That is extremely useful - my regex skills are > pretty poor but this really helps with getting to grips with routes.py. > > Love the 'tips of the day' -

Re: [web2py] Re: tip of the day. The power of routes

2010-10-18 Thread Michele Comitini
WoW :D 2010/10/18 Albert Abril : > Wow! Thank you Massimo. > Just now I was having that problem. > > On Mon, Oct 18, 2010 at 9:01 AM, Tom Atkins wrote: >> >> Fantastic - thanks Massimo.  That is extremely useful - my regex skills >> are pretty poor but this really helps with getting to grips with

[web2py] Re: tip of the day. The power of routes [CLOSED]

2010-10-24 Thread mdipierro
:-) On Oct 24, 11:19 pm, VP wrote: > Great. It appears to be working as intended now.  Thanks.

Re: [web2py] Re: tip of the day. The power of routes

2014-07-03 Thread Nguyen Minh Tuan
Hi Massimo, Lyn2py posted above is that issue I met, I post complete script : (I mark the only one line I changed with red color) -- routes.py --- config = ''' site1.com.vn /hhp/default site2.com.vn /welcome/default ''' def auto_in(apps): routes = [

Re: [web2py] Re: tip of the day. The power of routes

2014-07-04 Thread lyn2py
Hi Tuan I will try your modification when I get back to my terminal and post back on the results. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You re

Re: [web2py] Re: tip of the day. The power of routes

2014-07-05 Thread lyn2py
Hi Tuan, I tried the change (line in red) but it couldn't route to my app properly. I'm not familiar with the regex routes, so I'm using it as-is. I don't know how to troubleshoot this. On Friday, July 4, 2014 9:59:37 AM UTC+8, Nguyen Minh Tuan wrote: > > Hi Massimo, > > Lyn2py posted above

Re: [web2py] Re: tip of the day. The power of routes

2014-07-06 Thread Nguyen Minh Tuan
Hi Lyn2py, can you send your script? On 5 July 2014 14:33, lyn2py wrote: > Hi Tuan, > > I tried the change (line in red) but it couldn't route to my app properly. > I'm not familiar with the regex routes, so I'm using it as-is. I don't know > how to troubleshoot this. > > > > On Friday, July 4,