Package gluon :: Module main
[hide private]
[frames] | no frames]

Module main

source code

This file is part of web2py Web Framework (Copyrighted, 2007) Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: GPL v2

Classes [hide private]
  HttpServer
Functions [hide private]
 
get_client(env) source code
 
serve_controller(request, response, session)
this function is used to generate a dynmaic page.
source code
 
check_error_route(status, app)
Unless the error code is redirected, we want to send error messages out with HTTP status 200.
source code
 
wsgibase(environ, responder)
this is the gluon wsgi application.
source code
 
save_password(password, port)
used by main() to save the password in the parameters.py file.
source code
 
appfactory(wsgiapp=<function wsgibase at 0x2f767f0>, logfilename='httpsever.log', web2py_path='/Users/massimodipierro/web2py') source code
Variables [hide private]
  regex_url = re.compile(r'(?:^$)|(?:^\w+/?$)|(?:^\w+/\w+/?$)|(?...
  regex_client = re.compile(r'[\w-]+(\.[\w-]+)*\.?')
  working_folder = '/Users/massimodipierro/web2py'
Function Details [hide private]

serve_controller(request, response, session)

source code 

this function is used to generate a dynmaic page. It first runs all models, then runs the function in the controller, and then tries to render the output using a view/template. this function must run from the [applciation] folder. A typical examples would be the call to the url /[applicaiton]/[controller]/[function] that would result in a call to [function]() in applications/[application]/[controller].py renedred by applications/[application]/[controller]/[view].html

check_error_route(status, app)

source code 

Unless the error code is redirected, we want to send error messages out with HTTP status 200. Otherwise IE won't display them.

wsgibase(environ, responder)

source code 

this is the gluon wsgi application. the furst function called when a page is requested (static or dynamical). it can be called by paste.httpserver or by apache mod_wsgi.


Variables Details [hide private]

regex_url

Value:
re.compile(r'(?:^$)|(?:^\w+/?$)|(?:^\w+/\w+/?$)|(?:^(\w+/){2}\w+/?$)|(\
?:^(\w+/){2}\w+(/[\w-]+(\.[\w-]+)*)+$)|(?:^(\w+)/static(/[\w-]+(\.[\w-\
]+)*)+$)')