On 10 Jan 2013, at 11:04 AM, Andrew W <[email protected]> wrote:
> Anyway, for my auth.wiki app, I don't want people to see this:
> http://www.myweb2pywebsite.com/init/default/index/my_wiki_page
> 
> I want them to see:
> http://www.myweb2pywebsite.com/my_wiki_page,   or maybe with the index in 
> there too.
> 
> How do I do it ?
> 

Use the parametric router, specifying init and default as the default 
application and controller respectively (which they are by default, but it 
doesn't hurt to say so). That will give you what you want, but with index 
showing (note that you could change your default function to 'wiki' instead of 
'index', which might be prettier.

If you want to get rid of 'index', you need to supply a list of all functions 
in your default controller (functions=). 

In addition to the book, have a look at the comments at the head of 
router.example.py.

You might end up with something like this:

routers = dict(

    # base router
    BASE=dict(
        default_application='init',
    ),

    init=dict(
        default_controller='default',
        default_function='wiki',
        functions=['index', 'wiki', 'user', ...],
    ),
)


You might be tempted to name both your application and your default function 
'wiki'. Don't do that; the ambiguity will prevent the router from making some 
omissions you might otherwise prefer to have.

-- 



Reply via email to