I consider this a router bug. The problem is that the list of functions 
must include the function.extension combination in cases where URLs might 
include extensions. So, in the router, change:

        functions = ['index', 'user', 'download', 'call', 'test_load']

to:

        functions = ['index', 'user', 'download', 'call', 'test_load.load']

More, generally, if you plan to call a given function with multiple 
extensions (and possibly no extension), you must include all possibilities:

            functions = ['myfunc', 'myfunc.load', 'mfunc.json', 'myfunc.xml'
]

I made a pull request to fix this: 
https://github.com/web2py/web2py/pull/1558

Anthony

On Friday, January 13, 2017 at 10:51:03 AM UTC-5, Gaurav Vichare wrote:
>
> I was unable to access http://127.0.0.1:8000/admin as well, so I first 
> removed attached routes.py and then created w2p package. Chrome gave error 
> "Too many redirects".
>
> Please find attached minimal app and web2py/routes.py file.
> I am using web2py 2.14.6
>
> Thank You
>
> On Friday, January 13, 2017 at 8:34:42 PM UTC+5:30, Anthony wrote:
>>
>> Please attach a minimal app that reproduces the problem (along with 
>> routes.py).
>>
>> On Thursday, January 12, 2017 at 12:35:41 PM UTC-5, Gaurav Vichare wrote:
>>>
>>> I have LOAD component in my application. I made changes in 
>>> web2py/routes.py file and made my application default application, 
>>> 'default' controller and 'index' function as defaults. Also added function 
>>> list of default.py controller in routes.py to distinguish between args and 
>>> function name(
>>> https://groups.google.com/d/msg/web2py/yi5rPK4APKs/rVBg9AiShPUJ). Now 
>>> when I open my app (http://127.0.0.1:8000/  or 
>>> http://127.0.0.1:8000/test/default/index), load component div loads 
>>> complete app in it, and this goes in loop. 
>>>
>>> Here is routes.py and minimal code
>>>
>>> #routes.py
>>>
>>> routers = dict(
>>>
>>>     # base router
>>>     BASE=dict(
>>>         default_application='test',
>>>         default_controller = 'default',
>>>         default_function = 'index',
>>>         functions = ['index', 'user', 'download', 'call',
>>>                      'test_load'],
>>>     ),)
>>>
>>>
>>> --------------
>>>
>>> # default.pydef index():
>>>     return dict(message=T('Welcome to web2py!'))
>>> def test_load():
>>>     return dict(message=T('This is sample component'))
>>>
>>> -----------
>>>
>>> # Views<!--index.html-->{{extend 
>>> 'layout.html'}}<h2>{{=message}}</h2>{{=LOAD('default','test_load.load',ajax=True)}}
>>>
>>> <!--test_load.load-->{{=message}}
>>>
>>>
>>> Screenshot:
>>>
>>>
>>> <https://lh3.googleusercontent.com/-kzjMQDqkp5s/WHe9D_Hw-BI/AAAAAAAAh94/RpPPXJujFkoJK2IwMvhixF3Reo1Uh_vmACLcB/s1600/load.png>
>>>
>>> Please help me to solve this issue.
>>>
>>> Thank You
>>> - Gaurav
>>>
>>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to