On 20 May 2013, at 7:55 AM, Monte Milanuk <[email protected]> wrote:

> On Sunday, May 19, 2013 9:56:45 PM UTC-7, Jonathan Lundell wrote:
> You may need to restart web2py after making changes to routes.py
> 
> Did that, several times.
>  
> (changing it in web2py root is fine).
> 
> If I have a routes.py in both <web2py_root> and in the application folder, 
> which one takes precedence?

The application's routing dictionary will be used to update the base routing 
dictionary, so it overrides on an item-by-item basis.

>  
>  
> http://127.0.0.1:8000/myapp is a special case that will give you 
> default/index independent of a routes file.
> 
> 
>  In this case, my app name is 'my_contacts', as in 
> 'http://127.0.0.1:8000/my_contacts'

It's true for any app name. web2py, without any routing, assumes default/index 
as the default path to a controller and function.

The critical test at this point is that the URL() function (it's used by the 
menu) should be generating shortened URLs. If it's not, then web2py is for some 
reason not seeing your routes.py, or it has perhaps a typo.

As a test, you might try doing this in the base directory:

cp router.example.py routes.py

... removing any routes.py in your application's directory, restarting web2py, 
and looking at what you get from your menu. If that works (it should), then 
edit routes.py with your app name as the default. 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to