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]
 
RFC1123_DATETIME(seconds) source code
 
serve_controller(request, response, session)
this function is used to generate a dynmaic page.
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 0x2c8b630>, logfilename='httpsever.log', web2py_path='/Users/massimodipierro/Current/Python Programs/web2py') source code
Variables [hide private]
  regex_url = re.compile(r'(?:^$)|(?:^(\w+/?){,3}$)|(?:^(\w+/){3...
  regex_session_id = re.compile(r'([0-9]+\.)+[0-9]+')
  error_message = '<html><body><h1>Invalid request</h1></body></...
  error_message_ticket = '<html><body><h1>Internal error</h1>Tic...
  working_folder = '/Users/massimodipierro/Current/Python Progra...
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

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+/?){,3}$)|(?:^(\w+/){3}\w+(/?\.?[\w-\.]+)*\
/?$)|(?:^(\w+)/static(/\.?[\w-\.]+)*/?$)')

error_message

Value:
'<html><body><h1>Invalid request</h1></body></html>'

error_message_ticket

Value:
'<html><body><h1>Internal error</h1>Ticket issued: <a href="/admin/def\
ault/ticket/%s" target="_blank">%s</a></body></html>'

working_folder

Value:
'/Users/massimodipierro/Current/Python Programs/web2py'