I assume you don't have an actual /views/default/hello.html view defined in 
your app. In that case, web2py will fall back to the /views/generic.html 
view. However, by default, generic views are disabled (due to a security 
risk). In the "welcome" app, the /models/db.py model file enables all 
generic views for local requests only, so if you're using that db.py file, 
that's why the generic view is working for you on the local machine but not 
remotely. See http://web2py.com/books/default/chapter/29/10#Generic-views.

Anthony

On Thursday, March 1, 2012 6:58:17 PM UTC-5, Wei Li wrote:
>
> Hi,
>
> I just setup a web2py application. Everything is ok except one thing: if I 
> access the URL from another machine which is not the web2py server is 
> running, then the function I wrote in controllers/default.py won't be 
> converted to a view. It gives an errro about "invalide view".
>
> Here is the example
>
> 1. run web2py at computer_A:
> @computer_A%>   python web2py -p 8888 -a 12345 -i computer_A
>
> 2. modify the default.py in controller, assume the project name is myproj:
>     #FILE: applicaions/myproj/controllers/default.py 
>     def hello():
>         return dict(message="hello")
>
> 3. visit it at computer_A:
> http://computer_A/myproj/default/index   => good
> http://computer_A/myproj/default/hello    => good
>
> 4. visit it at computer_B:
> http://computer_A/myproj/default/index   => good
> http://computer_A/myproj/default/hello    => *Error* *"invalid view 
> (default/hello.html)"*
>
> I am trying to debug the problem but no progress yet due to lack of 
> experiences......
>
> Any help is appreciate.
>
>

Reply via email to