You are awesome. Thank you!
On Friday, September 13, 2013 3:26:54 PM UTC-7, Anthony wrote: > > > 1. >> Any time I log on to the website remotely and try to edit the site I get: >> "Admin >> is disabled because insecure channel" >> This is bothersome, as I want to be able to leave the Pi at work on a >> test system and play with it from home. >> > > admin requires connection via SSL or localhost, otherwise it's a serious > security risk. To get a localhost connection, you can ssh into the server. > > > >> 2. >> I am unable to make and use my own controller function. >> I have both my controller function in the "default.py" controller, and I >> made my own "test_controller.py" file that I have the same function in that >> file. >> >> This always works: http://MY_IP/test_app/*default* >> /test_controller_function >> But this: http://MY_IP/test_app/*test_controller* >> /test_controller_function >> >> returns the message: *invalid view >> (test_controller/test_controller_function.html)* >> > > If your controller returns a dict, web2py assumes it must then execute a > view, and by default it looks for the view in /views/[controller > name]/[function name].[request extension]. You can direct it to a different > view by setting response.view to a different file path within the /views > folder. You can also take advantage of the generic.html view. By default, > generic views are turned off, but in the scaffolding app, there is a line > in the db.py model file that turns them on on localhost only. > > Note, if you don't want to use a view at all, then just have your > controller return a string instead of a dict. > > >> 3. >> Why must you have a .html file that matches the name of the function you >> are "calling"? >> >> e.g. if you go to: http://MY_IP/test_app/default/test_controller_function >> I had to make a test_controller_function.html >> > > See above. Note, the name doesn't have to match -- that's just a default > -- you can use a different name but you must then be explicit about it by > setting response.view or calling response.render() directly. > > Check out the Workflow and Dispatching sections of the > Core<http://web2py.com/books/default/chapter/29/04/the-core>chapter as well > as > http://web2py.com/books/default/chapter/29/10/services#Generic-views. > > Anthony > -- 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/groups/opt_out.

