Re: [web2py] Re: routes.py Python 3 regex error

2018-09-28 Thread Bryan Chance
Added those, but the underlying issue is still there. On Fri, Sep 28, 2018 at 12:32 PM Leonel Câmara wrote: > You probably need to use raw strings in routes_in too if that \\g is > indeed just \g > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://gith

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim S
Have you looked at /var/log/nginx/error.log? -Jim On Monday, May 23, 2016 at 11:54:31 AM UTC-5, BlueShadow wrote: > > Os: ubuntu 16.04. Webserver: Nginx url: www.movie-alarm.de > Am 23.05.2016 18:52 schrieb "Jim Steil" >: > >> What OS? >> >> On Mon, May 23, 2016 at 11:52 AM, Jim Steil > > wrote:

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Kevin Bethke
Os: ubuntu 16.04. Webserver: Nginx url: www.movie-alarm.de Am 23.05.2016 18:52 schrieb "Jim Steil" : > What OS? > > On Mon, May 23, 2016 at 11:52 AM, Jim Steil wrote: > >> What webserver, and what URL are you accessing? >> >> On Mon, May 23, 2016 at 11:45 AM, Jim Steil wrote: >> >>> And, what is

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
What OS? On Mon, May 23, 2016 at 11:52 AM, Jim Steil wrote: > What webserver, and what URL are you accessing? > > On Mon, May 23, 2016 at 11:45 AM, Jim Steil wrote: > >> And, what is the error? >> >> On Mon, May 23, 2016 at 11:33 AM, BlueShadow >> wrote: >> >>> #!/usr/bin/python >>> # -*- codi

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
What webserver, and what URL are you accessing? On Mon, May 23, 2016 at 11:45 AM, Jim Steil wrote: > And, what is the error? > > On Mon, May 23, 2016 at 11:33 AM, BlueShadow > wrote: > >> #!/usr/bin/python >> # -*- coding: utf-8 -*- >> >> >> routers = dict( >> BASE = dict( >> domains =

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Kevin Bethke
like I said an internal server error so I guess the error is before web2py? On Mon, May 23, 2016 at 6:45 PM, Jim Steil wrote: > And, what is the error? > > On Mon, May 23, 2016 at 11:33 AM, BlueShadow > wrote: > >> #!/usr/bin/python >> # -*- coding: utf-8 -*- >> >> >> routers = dict( >> BASE

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
And, what is the error? On Mon, May 23, 2016 at 11:33 AM, BlueShadow wrote: > #!/usr/bin/python > # -*- coding: utf-8 -*- > > > routers = dict( > BASE = dict( > domains = { > 'domain.com' : 'App', > 'www.domain.com' : 'App', > '111.111.111.111/test' : 'test

Re: [web2py] Re: routes.py

2013-05-03 Thread Loïc
The '!' character comes from the following thread : https://groups.google.com/forum/?fromgroups=#!searchin/web2py/routes_in$20massimo$20%22!$24a%22/web2py/WLEtec0asUc/PfT9pAlMv5QJ In this thread, Massimo said : "*You need the "!" or some other id to prevent conflits with admin and other internal U

Re: [web2py] Re: routes.py

2013-05-03 Thread Jonathan Lundell
On 3 May 2013, at 9:02 AM, Loïc wrote: > After some tries, I have found a solution : > > In web2py folder : > routes.py > # -*- coding: utf-8 -*- > routes_app = ((r'/(?Padmin)\b.*', r'\g'), > (r'(.*)', r'myApp'), > (r'/?(.*)', r'myApp')) > > In my app folder : > ro

Re: [web2py] Re: routes.py not working in 2.0.9

2012-10-26 Thread Massimo Di Pierro
Will check and fix this asap On Thursday, 25 October 2012 11:02:39 UTC-5, LightOfMooN wrote: > > Current pattern-based system is perfect. We made more than 20 projects > with it. > But it does not work on new web2py version (2.2.1). We used 1.99.7 before. > > четверг, 25 октября 2012 г., 18:23:13

Re: [web2py] Re: routes.py not working in 2.0.9

2012-10-25 Thread LightOfMooN
Current pattern-based system is perfect. We made more than 20 projects with it. But it does not work on new web2py version (2.2.1). We used 1.99.7 before. четверг, 25 октября 2012 г., 18:23:13 UTC+5 пользователь Massimo Di Pierro написал: > > We'll change them in web3py. Suggestions? > > On Thur

Re: [web2py] Re: routes.py not working in 2.0.9

2012-10-25 Thread Massimo Di Pierro
We'll change them in web3py. Suggestions? On Thursday, 25 October 2012 06:10:44 UTC-5, Vasile Ermicioi wrote: > > since I started with web2py routes were the most uneasy and unstable part > of web2py, > and how awesome is web2py in all other parts - dal, template, sql forms, > authentication, bu

Re: [web2py] Re: routes.py not working in 2.0.9

2012-10-25 Thread Vasile Ermicioi
since I started with web2py routes were the most uneasy and unstable part of web2py, and how awesome is web2py in all other parts - dal, template, sql forms, authentication, building services(json,xml) but with routes always had problems - no unicode support, very hard to 'rewrite' urls, not quite

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-30 Thread peter
Thanks Jonathan. I wish I had known about rewrite logging a couple of days ago. Could I suggest that mention is made of this in the section of the book on rewriting URLs. It could save people a lot of time. Could I also suggest that routes_app=[('.*://mydomain:\w* /$anything','myapp'), is gi

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-30 Thread Jonathan Lundell
On 30 Aug 2012, at 1:59 AM, peter wrote: > I got inside gluon. The conversion is done within regex_uri > > I have found that > > http://127.0.0.1:8002/gallery > becomes > 127.0.0.1:http://127.0.0.1:get /gallery > > just before the conversion > > http://localhost:8002/gallery > becomes > 127.0

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-30 Thread peter
I got inside gluon. The conversion is done within regex_uri I have found that http://127.0.0.1:8002/gallery becomes 127.0.0.1:http://127.0.0.1:get /gallery just before the conversion http://localhost:8002/gallery becomes 127.0.0.1:http://localhost:get /gallery So Massimo was almost right the

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
Thanks for the suggestion Massimo It did not match with localhost or 127.0.0.1 eg localhost:8002/gallery Peter On Wednesday, 29 August 2012 18:19:26 UTC+1, Massimo Di Pierro wrote: > > Are you trying to match the remote address as localhost? The problem is that > it depends on what you browser

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Jonathan Lundell
On 29 Aug 2012, at 10:08 AM, peter wrote: > I tried > > routes_in = ((r' .*://localhost:.*',r'/welcome'),) > > and > routes_in = ((r' .*localhost.*',r'/welcome'),) > > > neither match localhost urls so I am at a loss. I would like to know how to > match localhost. If there's actually a spac

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Massimo Di Pierro
Are you trying to match the remote address as localhost? The problem is that it depends on what you browser puts in there. You can try: routes_in = [('127\.0\.0\.1:http://.*?:(GET|POST) /$anything','/welcome')] On Wednesday, 29 August 2012 12:08:56 UTC-5, peter wrote: > > I tried > > routes

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
I tried routes_in = ((r' .*://localhost:.*',r'/welcome'),) and routes_in = ((r' .*localhost.*',r'/welcome'),) neither match localhost urls so I am at a loss. I would like to know how to match localhost. In the short run I want to do domains={ 'ukjazz.net':'british_jazz', 'www.ukj

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Jonathan Lundell
On 29 Aug 2012, at 8:13 AM, peter wrote: > I am not sure what docs you are referring to Jonathan. The book gives an > example: > "The general syntax for routes is more complex than the simple examples we > have seen so far. Here is a more general and representative example: > > 1. > 2. > 3. > 4

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
I am not sure what docs you are referring to Jonathan. The book gives an example: "The general syntax for routes is more complex than the simple examples we have seen so far. Here is a more general and representative example: 1. 2. 3. 4. routes_in = ( ('140\.191\.\d+\.\d+:https://www.web2py.c

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
I do not know what docs you are talking about here Jonathan. If the book, then it is very brief on this matter. The example "The general syntax for routes is more complex than the simple examples we have seen so far. Here is a more general and representative example: 1. 2. 3. 4. routes_in = (

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Jonathan Lundell
On 29 Aug 2012, at 6:46 AM, peter wrote: > Okay, I get it now, routes_app does not select the application, only where to > get the substitute routes.py. The book is right with hindsight, but did not > lead me to the right understanding. Maybe it should be clearer that it only > controls which

Re: [web2py] Re: routes.py changed but user still called from default

2012-08-20 Thread Simon Carr
Your correct, i found the issue. I had removed default thinking i didn't need once i had written my other functions. Thanks for everyone's help this evening. Simon On 20 Aug 2012 23:51, "Anthony" wrote: > Do you have a default.py controller with a user() function? Does the > problem go away i

Re: [web2py] Re: routes.py changed but user still called from default

2012-08-20 Thread Jonathan Lundell
On 20 Aug 2012, at 3:51 PM, Anthony wrote: > Do you have a default.py controller with a user() function? Does the problem > go away if you remove routes.py altogether? > > Anyway, instead of the routes you have (which is legacy functionality), > you're better off using the parameter-based route

Re: [web2py] Re: routes.py vs mod_rewrite

2012-07-11 Thread Jonathan Lundell
On 11 Jul 2012, at 1:19 AM, Athelionas wrote: > Than I'll go with routes.py. It's much easier than mod_rewrite and also 100% > portable which is a killer feature. There's also no reason you can't use both. Go with routes.py and add an Apache rewrite if you want to speed up static accesses. There

Re: [web2py] Re: routes.py vs mod_rewrite

2012-07-10 Thread Jonathan Lundell
On 10 Jul 2012, at 4:49 PM, Anthony wrote: > routes.py will also handle rewriting outgoing URLs via the URL() function. And by default, the parametric router doesn't shorten static URLs, so as to make them easier to handle via Apache's mod_rewrite or the like. > > Anthony > > On Tuesday, July

Re: [web2py] Re: routes.py

2012-05-27 Thread Jonathan Lundell
On May 27, 2012, at 9:40 AM, chinakr wrote: > I tried > ('.*http://yueche.haijia.org.* /', '/yueche/default/index'), > but nothing I expected happened. Why? For simple domain-to-app mapping, you may find the parametric router a little easier to configure. routers = dict( domains = {

Re: [web2py] Re: routes.py

2012-04-20 Thread Jonathan Lundell
On Apr 20, 2012, at 6:20 AM, Wikus van de Merwe wrote: > OK, so if I define the list of function, the situation is clear. If I don't > and I want to pass arguments to the default function I need to use the > default function name (/default_function/arg). Arguments alone (/arg) in that > case wou

Re: [web2py] Re: routes.py

2012-04-20 Thread Wikus van de Merwe
OK, so if I define the list of function, the situation is clear. If I don't and I want to pass arguments to the default function I need to use the default function name (/default_function/arg). Arguments alone (/arg) in that case would be treated as if it is a function name (even if it does not

Re: [web2py] Re: routes.py

2012-04-19 Thread Jonathan Lundell
On Apr 19, 2012, at 12:24 PM, Wikus van de Merwe wrote: > Hmmm... So how does the router know if /abc is (1) function - > /default_app/default_controller/abc or (2) argument - > /default_app/default_controller/default_function/abc? If you supply a functions list, then it's a function if it's in

Re: [web2py] Re: routes.py

2012-04-19 Thread Wikus van de Merwe
Hmmm... So how does the router know if /abc is (1) function - /default_app/default_controller/abc or (2) argument - /default_app/default_controller/default_function/abc?

Re: [web2py] Re: routes.py

2012-04-18 Thread Jonathan Lundell
On Apr 17, 2012, at 11:58 PM, IVINH wrote: > Thank you, but I can use the syntax as: 'domain.com': 'domain.com:8000' to > redirect with routes.py? No. Web2py (and its router) can't do anything until they receive the packet. If they listen on port 8000 and the browser sends the request to port 80

Re: [web2py] Re: routes.py

2012-04-17 Thread IVINH
Thank you, but I can use the syntax as: 'domain.com': 'domain.com:8000' to redirect with routes.py? Vào 21:03:21 UTC+7 Thứ ba, ngày 17 tháng tư năm 2012, Jonathan Lundell đã viết: > > On Apr 17, 2012, at 1:31 AM, IVINH wrote: > > Web2py server running at port 8000, how to redirect mydomain.co

Re: [web2py] Re: routes.py

2012-04-17 Thread Jonathan Lundell
On Apr 17, 2012, at 7:33 AM, Wikus van de Merwe wrote: > Oh, so the default for functions is ALL_FUNCTIONS? In the comments it says: > "list of valid functions in the default controller (default None)". From that > I concluded (without testing I admit) that by default no function name will > be

Re: [web2py] Re: routes.py

2012-04-17 Thread Wikus van de Merwe
Oh, so the default for functions is ALL_FUNCTIONS? In the comments it says: "list of valid functions in the default controller (default None)". From that I concluded (without testing I admit) that by default no function name will be mapped unless explicitly specified. It make sense to map all f

Re: [web2py] Re: routes.py

2012-04-17 Thread Jonathan Lundell
On Apr 17, 2012, at 1:31 AM, IVINH wrote: > Web2py server running at port 8000, how to redirect mydomain.com to this > server without using the link mydomain.com:8000? A web browser using that URL will make a request on port 80. You either need to configure web2py to run on port 80 or use a fron

Re: [web2py] Re: routes.py

2012-04-17 Thread IVINH
HI, Web2py server running at port 8000, how to redirect mydomain.com to this server without using the link mydomain.com:8000? Vào 01:08:45 UTC+7 Thứ ba, ngày 17 tháng tư năm 2012, Jonathan Lundell đã viết: > > On Apr 16, 2012, at 10:57 AM, Wikus van de Merwe wrote: > > For this type of routi

Re: [web2py] Re: routes.py

2012-04-16 Thread Jonathan Lundell
On Apr 16, 2012, at 10:57 AM, Wikus van de Merwe wrote: > For this type of routing where you don't use complex regular expressions, it > is better to use the simple router. > It could make selected functions of the default controller in the default > application available directly, i.e. > /f1 ==

Re: [web2py] Re: Routes.py parameter, rewrite rules and redirect

2012-04-02 Thread Joseph Piron
Indeed, makes sense. Thanks for the confirmation :) On 02 Apr 2012, at 16:02, Jonathan Lundell wrote: > On Apr 2, 2012, at 3:27 AM, Joseph.Piron wrote: >> Ah, and another simple question, maybe dull.. :) >> >> Does the domains option have any use when web2py's app is served from a >> apache or

Re: [web2py] Re: Routes.py parameter, rewrite rules and redirect

2012-04-02 Thread Jonathan Lundell
On Apr 2, 2012, at 3:27 AM, Joseph.Piron wrote: > Ah, and another simple question, maybe dull.. :) > > Does the domains option have any use when web2py's app is served from a > apache or nginx frontend by wsgi ? Maybe. There are two reasons (that I can think of) why it might not. One is whether

Re: [web2py] Re: Routes.py parameter, rewrite rules and redirect

2012-04-02 Thread Joseph Piron
Nice! I am gonna try that ! On 02 Apr 2012, at 14:50, Anthony wrote: > If you want the default app removed from static URLs, you have to set > map_static=True in your router (see > http://code.google.com/p/web2py/source/browse/router.example.py#64). However, > if your web server (e.g., Apache

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Anthony, cool. I did come up with a very similar approach. routes_in = ( (r'^/model1/?$', APPNAME_MODEL1_URL), (r'^/model1/(?P[^/]*)/?$', APPNAME_MODEL1_ID_URL), (r'^/model1/(?P[^/]*)/model2/?$', APPNAME_MODEL2_URL), (r'^/model1/(?P[^/]*)/model2/

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
I suppose something like: routes_in = ( (r'/appname/model1/$id1/model2/$id2/model3/$id3', '/appname/model3/index/$id1/$id2/$id3'), (r'/appname/model1/$id1/model2/$id2', '/appname/model2/index/$id1/$id2'), (r'/appname/model1/$id1', '/appname/model1/index/$id1') ) In that case, the va

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
> > Not sure why so defensive. Sorry, not meaning to be defensive, just trying to explain how it works. > All I'm suggesting is that there is > precedent in simpler routing schemes: consider django's (or Rails'), > for instance. So far, you've only made two suggestions, one of which is alre

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Now more to our use case: a few days ago I wrote asking how could I accomplish and more logical-relational url scheme. One of the "hard" requirements from our customer is to have no action names in the URL and actions should be distinguished via REST. They also asked us to preserve relationships in

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 10:00 AM, Ruben Orduz wrote: > Not sure why so defensive. All I'm suggesting is that there is > precedent in simpler routing schemes: consider django's (or Rails'), > for instance. In django you have a urls.py at the root, and then > optionally one in your app folder. You have t

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Not sure why so defensive. All I'm suggesting is that there is precedent in simpler routing schemes: consider django's (or Rails'), for instance. In django you have a urls.py at the root, and then optionally one in your app folder. You have to explicitly tell the root urls.py which urls to use for

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
> > I would suggest the following behavior though: > > routes_in and routes out in the _base_ routes.py should be completely > ignored if routes_app is not commented out. > No, it should not. You may have multiple applications, but perhaps only some of them have app-specific routes (i.e., a route

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Perhaps I'm misreading your answers, but now I'm more confused. I'll keep bumping my head till I figure out a way or else use apache's mod_rewrite which is a heck lot more straight forward. I would suggest the following behavior though: routes_in and routes out in the _base_ routes.py should be c

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Anthony
> > I'm definitely confused with this routing scheme. > > There's the base routes.py (which is usually ignored due to file > name). > Note sure what you mean -- if you have a /web2py/routes.py file, it will not be ignored. web2py comes with two example files, routes.parameter_example.py and rout

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 8:18 AM, Ruben Orduz wrote: > Jonathan, thx for your answers. Now, as a pre-emtive follow up if I > have a routes.py in my app root directory: > > 1) should I rename/comment out the base routes.py? No, but all it needs is routes_app. > 2) should I commend routes_app in the ap

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
Jonathan, thx for your answers. Now, as a pre-emtive follow up if I have a routes.py in my app root directory: 1) should I rename/comment out the base routes.py? 2) should I commend routes_app in the app-specific routes.py? Thx. On Tue, Mar 20, 2012 at 11:11 AM, Jonathan Lundell wrote: > On Mar

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 8:09 AM, Ruben Orduz wrote: > > I'm definitely confused with this routing scheme. > > There's the base routes.py (which is usually ignored due to file > name). Inside this file there are 3 examples (routes_app, routes_in > and routes_out). So, assuming you change the name of t

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Ruben Orduz
I'm definitely confused with this routing scheme. There's the base routes.py (which is usually ignored due to file name). Inside this file there are 3 examples (routes_app, routes_in and routes_out). So, assuming you change the name of the file routes.py and restart your server, it will use routes

Re: [web2py] Re: routes.py not picking up

2012-03-20 Thread Jonathan Lundell
On Mar 20, 2012, at 7:22 AM, rdodev wrote: > Alright, I need some assistance in this regard. So, after I managed web2py to > pick up the routes.py, it simply won't work (not even with the provided > examples in that file). I keep getting "Bad Request" response even for the > "welcome" app. Not s

Re: [web2py] Re: routes.py not picking up

2012-03-19 Thread Ruben Orduz
Another thing that needs to be pointed out (at least this is the case in Windows) that modifications to this file require a full web2py server shutdown/restart. If you use the tk UI to "stop" server and then "start" server, it will not pick up changes in the file -- perhaps this is obvious to some,

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Anthony
> > ok removing those and re-starting web2py worked (well it broke, but that's > a good thing). Thx all for your help. If it's not on to-do list: maybe it > should be to improve (or to make clearer in the docs) how the routes.py > works and that you need to comment our routes_app in order for i

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Jonathan Lundell
On Mar 16, 2012, at 6:58 PM, Anthony wrote: > On Friday, March 16, 2012 9:46:33 PM UTC-4, Jonathan Lundell wrote: > On Mar 16, 2012, at 6:39 PM, Anthony wrote: >> I'm not sure, but I think if you have routes_app, it will ignore routes_in >> and routes_out in the root routes.py if the request is fo

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread rdodev
ok removing those and re-starting web2py worked (well it broke, but that's a good thing). Thx all for your help. If it's not on to-do list: maybe it should be to improve (or to make clearer in the docs) how the routes.py works and that you need to comment our routes_app in order for it to work.

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread rdodev
Let me remove those, and I'll check back. On Friday, March 16, 2012 9:58:12 PM UTC-4, Anthony wrote: > > On Friday, March 16, 2012 9:46:33 PM UTC-4, Jonathan Lundell wrote: >> >> On Mar 16, 2012, at 6:39 PM, Anthony wrote: >> >> I'm not sure, but I think if you have routes_app, it will ignore >>

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Anthony
On Friday, March 16, 2012 9:46:33 PM UTC-4, Jonathan Lundell wrote: > > On Mar 16, 2012, at 6:39 PM, Anthony wrote: > > I'm not sure, but I think if you have routes_app, it will ignore routes_in > and routes_out in the root routes.py if the request is for one of the apps > in routes_app. If you'r

Re: [web2py] Re: routes.py not picking up

2012-03-16 Thread Jonathan Lundell
On Mar 16, 2012, at 6:39 PM, Anthony wrote: > I'm not sure, but I think if you have routes_app, it will ignore routes_in > and routes_out in the root routes.py if the request is for one of the apps in > routes_app. If you're using routes_app, then you also need routes.py files > within the speci

Re: [web2py] Re: routes.py doesn't work

2012-02-11 Thread Jonathan Lundell
On Feb 11, 2012, at 12:51 PM, Lewis wrote: > The answer appears to be: yes, you must restart web2py. > > That means probably the sample in my first post would also work. > > So, a question: > > Why do the dictionaries need to be nested? In other words why is the > key "BASE" necessary? Becau

Re: [web2py] Re: routes.py doesn't work

2012-02-11 Thread Jonathan Lundell
On Feb 11, 2012, at 12:47 PM, Lewis wrote: > This doesn't work either: > > routers = dict( >BASE = dict( >default_application = 'try', >), > ) > > I placed the above as routes.py in the web2py folder (of /var as it > happens). All applications run when explicitly referenced as >

Re: [web2py] Re: routes.py and rewriting URLs

2011-08-15 Thread Jonathan Lundell
On Aug 15, 2011, at 2:40 PM, Anthony wrote: > On Monday, August 15, 2011 5:14:01 PM UTC-4, Jonathan Lundell wrote: > On Aug 15, 2011, at 11:38 AM, Anthony wrote: > >> You should also be able to go to /admin/default/reload_routes to reload >> routes.py, but it looks like there is currently a bug

Re: [web2py] Re: routes.py and rewriting URLs

2011-08-15 Thread Anthony
On Monday, August 15, 2011 5:14:01 PM UTC-4, Jonathan Lundell wrote: > > On Aug 15, 2011, at 11:38 AM, Anthony wrote: > > You should also be able to go to /admin/default/reload_routes to reload > routes.py, but it looks like there is currently a bug that is causing that > to fail. > > > Any idea

Re: [web2py] Re: routes.py and rewriting URLs

2011-08-15 Thread Jonathan Lundell
On Aug 15, 2011, at 1:20 PM, fishwebby wrote: > I tried your suggestion, with routes.py in the web2py directory, but > alas it didn't work. Not sure what I'm doing wrong (nice suggestion > about the print statement though to make sure it's working). You can also revise the doctests in routes.py t

Re: [web2py] Re: routes.py and rewriting URLs

2011-08-15 Thread Jonathan Lundell
On Aug 15, 2011, at 11:38 AM, Anthony wrote: > You should also be able to go to /admin/default/reload_routes to reload > routes.py, but it looks like there is currently a bug that is causing that to > fail. > Any idea why (or how)?

Re: [web2py] Re: Routes.py on GAE

2010-11-07 Thread Boris Manojlovic
Hello, reason for those kind of problems is that GAE separates application code from static data. so if you try from application do level redirects it will fail with that cryptic message as it does not have direct access to files , workaround is to use special function in application that will do

Re: [web2py] Re: routes.py routes_app and defaults

2010-09-23 Thread Albert Abril
yes, in this case i'm hosting a single app. I'll do it that way. thanks Massimo. On Thu, Sep 23, 2010 at 3:10 PM, mdipierro wrote: > If you host a single app the easy way is saying in routes.pt > > routes_in=[ > ('/bio/$anything', '/arritmia/bio/$anything') > ] > > routes_out=[ > ('/arritmia//

Re: [web2py] Re: Routes.py on GAE

2010-09-15 Thread Michael Ellis
I'm guessing that GAE decides at launch time which file types it will serve from which directories and that routes.py is unable to override the block at request time. I'm basing that on the "blocking access" msg when Launcher started and the 403's since those are issued when access is forbidden as

Re: [web2py] Re: Routes.py on GAE

2010-09-15 Thread Jonathan Lundell
On Sep 15, 2010, at 4:39 PM, Michael Ellis wrote: > Problem resolved, thanks to suggestion from cfh. Added explicit favicon.ico > handler That's good, but do we understand why the original didn't work? (Just curious.) > > > - url: /favicon.ico > static_files: applications/init/static/favic

Re: [web2py] Re: Routes.py on GAE

2010-09-15 Thread Michael Ellis
Problem resolved, thanks to suggestion from cfh. Added explicit favicon.ico handler - url: /favicon.ico static_files: applications/init/static/favicon.ico upload: applications/init/static/favicon.ico There's a bonus. It works without routes.py. That's handy because I didn't want to have t

Re: [web2py] Re: Routes.py on GAE

2010-09-15 Thread Jonathan Lundell
On Sep 15, 2010, at 3:46 PM, Michael Ellis wrote: > The error is reported by GAE Launcher, the test app you use before deploying > to GAE. Hence the OS X path. Nothing else seems wrong; the app's pages > render correctly etc. I don't know. Does routes.py do the right thing for favicon.ico if yo

Re: [web2py] Re: Routes.py on GAE

2010-09-15 Thread Michael Ellis
The error is reported by GAE Launcher, the test app you use before deploying to GAE. Hence the OS X path. Nothing else seems wrong; the app's pages render correctly etc. On Wed, Sep 15, 2010 at 6:16 PM, Jonathan Lundell wrote: > On Sep 15, 2010, at 2:53 PM, Michael Ellis wrote: > > > > Not sur

Re: [web2py] Re: Routes.py on GAE

2010-09-15 Thread Jonathan Lundell
On Sep 15, 2010, at 2:53 PM, Michael Ellis wrote: > > Not sure if this is related; apologies if not. > I have web2py/routes.py containing > > """ > routes_in = ( > ('/favicon.ico', '/init/static/favicon.ico'), > ('/robots.txt', '/init/static/robots.txt'), > ) > routes_out = () > """ > > and ap

Re: [web2py] Re: Routes.py on GAE

2010-09-14 Thread Jonathan Lundell
Massimo, here's a patch. In rewrite.py, change this: exec routesfp.read() in symbols to this: exec routesfp.read().translate(None, '\r') in symbols (and test) I notice that there's something like this elsewhere: def compile2(code,layer): """ The +'\n' is necessary els

Re: [web2py] Re: Routes.py on GAE

2010-09-14 Thread Jonathan Lundell
On Sep 13, 2010, at 11:44 PM, Miguel Goncalves wrote: > Hi > > So I installed the debugging code and following the errors it was giving me I > got rid of empty lines. OK, this took longer than it should have, largely thanks to Python's terse error messages. The problem is that you're using DOS

Re: [web2py] Re: Routes.py on GAE

2010-09-13 Thread Miguel Goncalves
Hi So I installed the debugging code and following the errors it was giving me I got rid of empty lines. My current routes.py is (I also attached it compressed to this mail): #!/usr/bin/python # -*- coding: utf-8 -*- default_application = 'reviewround' # ordinarily set in base routes.py defau

Re: [web2py] Re: Routes.py on GAE

2010-09-12 Thread Jonathan Lundell
On Sep 12, 2010, at 11:46 AM, Miguel Goncalves wrote: > I attached the zipped routed file to this email. Thank you. It looks OK. Miguel, if I send you a small patch for rewrite.py, to add a little debugging, could you run it for me? What I have in mind (and feel free to do this for yourself if

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 9:07 PM, Miguel Goncalves wrote: > in my case I was using the following routes.py What I'm looking for is the file itself (preferably zipped). I'm wondering if there might be something in it that isn't surviving a paste into email, because I don' t seen anything in line 3 that

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Miguel Goncalves
in my case I was using the following routes.py #!/usr/bin/python # -*- coding: utf-8 -*- default_application = 'reviewround' # ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' routes_in = ( ('/', '

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 9:17 AM, mdipierro wrote: > > try: >import rocket > except: >logging.warn('unable to import Rocket') > > True. This is supposed to fail on GAE. I will change it. No need to > try the import and issue a warning on GAE. ...which leaves the mystery of the routes syntax er

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 7:49 AM, mdipierro wrote: > > gaehanlder.py does not import Rocket. main imports Rocket > Is it possible gaehandler.py or > app.yaml were modified? > > On Sep 9, 9:40 am, Jonathan Lundell wrote: >> On Sep 9, 2010, at 6:27 AM, mdipierro wrote: >> >> >> >>> I do not underst

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 6:27 AM, mdipierro wrote: > > I do not understand where "unable to import Rocket" comes from. That's a strange error. Also, the syntax error on routes.py is on line 3, which is empty; there's no code until line 4. My advice is to resolve the first error (Rocket) before worryi

Re: [web2py] Re: Routes.py on GAE

2010-09-08 Thread Miguel Goncalves
Hi Massimo Did you, by any chance, make any progress on this issue? Thanks Miguel On Tue, Sep 7, 2010 at 4:43 AM, mdipierro wrote: > Thanks for the reminder. I will look into this today. > > On Sep 7, 1:28 am, Miguel Goncalves wrote: > > Hi > > > > I guess this bug has not been fixed yet? >

Re: [web2py] Re: Routes.py on GAE

2010-09-06 Thread Miguel Goncalves
Hi I guess this bug has not been fixed yet? I am getting the following error: unable to import Rocket Your routes.py has a syntax error Please fix it before you restart web2py Traceback (most recent call last): File "/base/data/home/apps/reviewround/1.344628390884008259/gluon/rewrite.py", line

Re: [web2py] Re: routes.py in applications or how to access request in routes.py

2010-08-06 Thread Jonathan Lundell
On Aug 6, 2010, at 7:52 AM, Lasiaf wrote: > cool. > is there any date on when it will be added? I've been promising to write a new route-rewriter for months now, and not finding the time. Massimo has suggested an interim solution to allow app-specific routing using the current logic which ought

Re: [web2py] Re: Routes.py on GAE

2010-05-25 Thread Chris S
Any news on this bug? I havent seen anything. Chris S wrote: > Apparently it doesn't copy/paste correctly. The second routes.py that > I used kept the entire routes_in in a single line. > > On May 15, 10:00 am, Chris S wrote: > > I've updated my code and run it again.  Sorry for the delay last

Re: [web2py] Re: routes.py not working

2010-03-19 Thread Vasile Ermicioi
yes, to apply changes in routes you need to restart web server -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@google

Re: [web2py] Re: routes.py not working

2010-03-19 Thread Vasile Ermicioi
you use init, sorry routes_in = ( ('/admin/(.*)', '/admin/$1'), ('/(.*)', '/init/$1'), ) -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to

Re: [web2py] Re: routes.py not working

2010-03-19 Thread Vasile Ermicioi
or better this routes_in = ( ('/admin/(.*)', '/admin/$1'), ('/(.*)', '/999/$1'), ) -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2

Re: [web2py] Re: routes.py not working

2010-03-19 Thread Vasile Ermicioi
try something like that routes_in = ( ('/([^(admin)]*)', '/init/$1'), ) -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr