I use the stock Rocket server that comes with web2py and I restart it 
 after changing the routes.py. I must say that I don't fully understand the 
big picture of how the apps the compiler and the operating system 
cooperate. One time I uploaded a site to GAE with two separate apps but the 
tables in the models were named the same. web2py saw the models as separate 
and GAE as one and both apps were accessing the tables of the first app 
only.
In this project I kept my apps separate because I wanted to have a generic 
versions of each that I can quickly reuse elsewhere. Now I see this design 
might be flawed. 
I will follow your advice and place the code under one app. I feel too, 
that I might have a glitch in my setup. 
Big thank you for the help with routes.

Thanks for your time.

On Tuesday, August 29, 2017 at 8:52:49 AM UTC-4, Anthony wrote:
>
> Using the same routes, I cannot replicate the generated URLs you observe. 
> Make sure you reload routes (via admin) or restart the web server.
>
> Also, do you really need a separate init app and notes app? Especially the 
> init app -- what is it doing? If it just provides a single home page, that 
> doesn't belong in a separate app.
>
> Anthony
>
> On Monday, August 28, 2017 at 7:57:39 PM UTC-4, 98u...@gmail.com 
> <javascript:> wrote:
>>
>> I removed routes_in and routes_out. The routes.py file in the site's root 
>> looks like so:
>>
>>
>> routers = dict(
>>     # base router
>>     BASE=dict(
>>         default_application='init',
>>     ),
>>     stock=dict(
>>         default_function='index',
>>         functions=dict(
>>             default=['index','call','download','user',],
>>             showcase=['index',]
>>             )
>>         ),
>> )
>>
>>
>> During development I launch the stock app from the administrative 
>> interface and the address bar shows:
>> https://192.168.1.25:8000/stock 
>> <https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1>
>> /default
>> During its running one  menu item STOCK (it serves as home button, 
>> beginning of listing) is visible, rendered by code:
>>
>> response.menu_stock = [(T('Stock'), False, 
>> URL('stock','default','index'), [])
>> ]
>>  upon clicking on it the address bar also shows:
>> https://192.168.1.25:8000/stock 
>> <https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1>
>> /default
>>
>> I have two more apps in this site:
>>
>> INIT- which is sort of like a facade for the website when you type the 
>> domain name in the browser it starts. 
>> I launch STOCK app from within INIT with the same menu construct as 
>> above. The browser also shows 'default'.
>>
>> NOTES- which are instructions to myself and my customer.
>>
>> I may add more apps in this project down the road.
>>
>> Curious, when I launch the app through address bar by typing: 
>> https://192.168.1.25:8000/stock 
>> <https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1>
>> the app starts and the address bar remains unchanged.
>>
>> Thanks for you time.
>>
>>  
>> On Monday, August 28, 2017 at 2:40:07 PM UTC-4, Anthony wrote:
>>>
>>> First, get rid of routes_in/routes_out -- they will not work in 
>>> conjunction with "router".
>>>
>>> Regarding "default" in the URL -- how are you generating the URL. You 
>>> can always add default_controller="default", but that should not be 
>>> necessary, as "default" is the default value for default_controller anyway.
>>>
>>> Anthony
>>>
>>> On Monday, August 28, 2017 at 2:14:15 PM UTC-4, 98u...@gmail.com wrote:
>>>>
>>>> Big thank you! This works.
>>>>
>>>> One little detail emerged though. Now that  I replaced the pattern 
>>>> router.py (having my line in routes_out as above) in my site root with the 
>>>> parameter rewrite method my URL shows 'default':
>>>>
>>>> https://192.168.1.25:8000/stock 
>>>> <https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1>
>>>> /default
>>>> and I was aiming for:
>>>> https://192.168.1.25:8000/stock 
>>>> <https://192.168.1.25:8000/stock/showcase/asset/2017-Some-fridge?id=79&_signature=c2e7899530c858f1b478cb7ea5f03bb30d4f68e1>
>>>>
>>>> I added a line: controllers='DEFAULT' has no effect:
>>>>
>>>> routers = dict(
>>>>     stock=dict(
>>>>         controllers='DEFAULT',
>>>>         default_function='index',
>>>>         functions=dict( 
>>>>             default=['index', ...],
>>>>             showcase=['index', ...]
>>>>         )
>>>>     ),
>>>> )
>>>>
>>>> Thanks for your time
>>>>
>>>> On Monday, August 28, 2017 at 11:19:09 AM UTC-4, Anthony wrote:
>>>>>
>>>>> On Monday, August 28, 2017 at 10:05:27 AM UTC-4, 98u...@gmail.com 
>>>>> wrote:
>>>>>>
>>>>>> No, the name 'index' withing 'showcase' is idle.
>>>>>>
>>>>>
>>>>> Then just use the parameter-based rewrite system with a configuration 
>>>>> like this:
>>>>>
>>>>> routers = dict(
>>>>>     stock=dict(
>>>>>         default_function='index',
>>>>>         functions=dict(
>>>>>             default=['index', ...],
>>>>>             showcase=['index', ...]
>>>>>         )
>>>>>     ),
>>>>> )
>>>>>
>>>>> Then simply change the "asset" function to "index".
>>>>>
>>>>> Anthony
>>>>>
>>>>

-- 
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 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to