On Mar 29, 2011, at 7:06 AM, Jonathan Lundell wrote:
>
> On Mar 29, 2011, at 6:58 AM, CVstash dot com wrote:
>>
>> Thanks a lot Jonathan for the reply. I did just that but it still
>> doesn't work out the shortcut even with this code:
>> *************
>> default_application='resume'
>>
>> routes_in = (
>> ('/view', '/resume/default/index'),
>> )
>> *************
>>
>> doing http://localhost:8000/ would redirect to the resume app just
>> fine, but doing http://localhost:8000/view gives an invalid request
>> error.
>
> Is there any clue in the error message as to the URL that it's using?
I created a quick unit test for that route, and it seems to work OK. What
version are you using, and did you restart web2py after editing routes.py?
>
>>
>> Thanks,
>> Arbie
>>
>> On Mar 29, 9:41 pm, Jonathan Lundell <[email protected]> wrote:
>>> On Mar 29, 2011, at 5:10 AM, CVstash dot com wrote:
>>>
>>>
>>>
>>>> so I made web2py/routes.py with this code:
>>>> *************
>>>> routers = dict(
>>>> BASE = dict(default_application='resume'),
>>>> )
>>>> routes_in = (
>>>> ('/view/', '/resume/default/cv/'),
>>>> (r'/view/<any>', r'/resume/default/cv/(?P<any>.*)'),
>>>> )
>>>> *************
>>>> The first part which maps the default controller works fine, but the
>>>> second one which should do the shortening of the url doesn't work at
>>>> all (says invalid request). I copied the first routes_in entry
>>>> directly from the book. Any thoughts?
>>>
>>> You can't mix the two routing styles. Start by removing the routers=
>>> section, and just specifying your default application:
>>>
>>> default_application='resume'
>
>