Routes

3 views
Skip to first unread message

kbochert

unread,
Nov 26, 2009, 12:21:47 PM11/26/09
to web2py-users
As a new user to web2py, I am trying to get routes.py to work.
Nothing I put into web2py/routes.py has any effect.

example:
routes_in=(
('^127\.0\.0\.1:.*',
'/examples/default/index'),
)

Moreover , clear errors in the routes.py have no effect.
i.e.
x = 6/0; @!

Am I overlooking something that I need to do to turn on the rewrite??

Karl

Yarko Tymciurak

unread,
Nov 26, 2009, 1:02:32 PM11/26/09
to web2py-users
routes.py is read when web2py starts - be sure to re-start whatever
server you are using (or restart web2py, if you are using the builting
server).

Wikus van de Merwe

unread,
Nov 26, 2009, 1:02:55 PM11/26/09
to web2py-users
Well, first, you don't need a comma after bracket, when there is only
one rule there.
Second, routes are only processed once when the server is first time
started. Are you restarting your app server each time you change it?

mdipierro

unread,
Nov 26, 2009, 1:36:46 PM11/26/09
to web2py-users
technically you can reload routes without restarting. From the admin
web based shell

from gluon.rewrite improt *
load()

On Nov 26, 12:02 pm, Yarko Tymciurak <resultsinsoftw...@gmail.com>
wrote:

kbochert

unread,
Nov 26, 2009, 2:05:42 PM11/26/09
to web2py-users


On Nov 26, 10:36 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> technically you can reload routes without restarting. From the admin
> web based shell
>
> from gluon.rewrite improt *
> load()
>
> On Nov 26, 12:02 pm, Yarko Tymciurak <resultsinsoftw...@gmail.com>
> wrote:
>
> > routes.py is read when web2py starts - be sure to re-start whatever
> > server you are using (or restart web2py, if you are using the builting
> > server).
>

A line in routes.py like
x = 6/0
does indeed produce a divide by zero error when web2py starts.


The routes:
routes_in=(
('^127\.0\.0\.1:.*',
'/examples/default/index'),
)
has no effect, even after a startup of web2py

Using the web based shell
>>>from gluon.rewrite import *
produces "error : undefined"

I'm using version 1.72.3

Karl

kbochert

unread,
Nov 27, 2009, 8:14:12 AM11/27/09
to web2py-users
The mistake I continually made was that

> routes_in=(
> ('^127\.0\.0\.1:.*',
> '/examples/default/index'),

should have been

> routes_in=(
> ('^127\.0\.0\.1:/.*',
> '/examples/default/index'),

This is a bad business for the punctuation-challenged.
thanks
Karl
Reply all
Reply to author
Forward
0 new messages