You are missing something. Let me explain:

What your code looks like in default.py after uncommenting auth.wiki() is 
this:

def index():
    return auth.wiki()

Web2py is working in the most obvious way. The URL structure in web2py is 
domain/app/controller/function. In this example localhost is your 
domain, simoncarr is your app, default is your controller, index is your 
function and contactme is a wiki page that the function is returning. If 
you go to localhost/simoncarr/default/contactme, web2py is looking for a 
function called contactme in default.py. That function does not exist. 
Contactme is a wiki page returned by auth.wiki().

You can use routes.py to rewrite URLs to hide the function or you can 
rename the function and set a new default in routes.py for that domain.

On Saturday, October 27, 2012 1:06:59 AM UTC-7, Simon Carr wrote:
>
> I feel as though I am missing something here. In default/index it states
>
> if you need a simple wiki simple replace the two lines below with:
>     return auth.wiki()
>
> From what I know so far about Web2Py, things just work in the most obvious 
> way.
>
> Why do the above comments not mention having to setup routing for 
> auth.wiki() to work? I am sure that I am missing something here, or there 
> is a bug in the way auth.wiki() is supposed to work.
>
> Simon
>
>
>
> On Saturday, 27 October 2012 04:18:09 UTC+1, HittingSmoke wrote:
>>
>> Default is your controller. You're running auth.wiki under the index 
>> function of the default controller. Your auth.wiki pages are called with 
>> auth.wiki so you need your index function which is where auth.wiki is.
>>
>> When you try to call localhost/simoncarr/default/contactme web2py is 
>> looking for a function called contactme in your default controller, which 
>> doesn't exist.
>>
>> You could hide the function part of the URL using routing if you want.
>>
>> On Friday, October 26, 2012 5:01:18 PM UTC-7, Simon Carr wrote:
>>>
>>> I know I have already been talking about auth.wiki() in another thread 
>>> but this is a different questions, so thought I should start a new thread.
>>>
>>> When I create a new page the following link to that page is created
>>>
>>> localhost/simoncarr/default/contactme
>>>
>>> when I click it I get the error 
>>> invalid function (default/contactme)
>>>
>>> If I navigate manually to localhost/simoncarr/default/index/contactme it 
>>> works fine (notice I had to include index in the url). How do I get 
>>> auth.wiki() to generate the correct link?
>>>
>>> If it helps I am running web2py through apache.
>>>
>>> Thanks
>>> Simon
>>>
>>>
>>>

-- 



Reply via email to