web/framework
A web application framework.
Strongly influenced by [Aaron Swartz][0]' "anti-framework" web.py
this library aims to cleanly abstract low-level web functionality through a Pythonic API.
Think about the ideal way to write a web app. Write the code to make it happen.
~ Aaron Swartz [1]
application(name, _prefix='', prefix='', model=None, db=True, static=None, icon=None, mounts=None, automount=False, autotemplate=False, wrappers=None, sessions=False, host=None, port=False, args=None) -> 'Application' # [source]
None
load_mounts() # [source]
None
get_host_hash(path) # [source]
None
get_sites() # [source]
get_apps() # [source]
best_match(handlers, *args, **kwargs) # [source]
textslug(title, delim='_', lower=True) # [source]
return a path slug containing a normalized version of title
Defaults to delimiting words by "_" and enforcing all lowercase. Also makes intelligent path-friendly replacements (e.g. "&" to "and").
>>> textslug("Surfing with @Alice & @Bob!") 'surfing_with_alice_and_bob'
timeslug(dt) # [source]
return a path slug containing date and time
Date is encoded in standard YYYY/MM/DD form while the time is encoded as the NewBase60 equivalent of the day's centiseconds.
anti_csrf(handler) # [source]
serve(wsgi_app, port=9300, socket=None, workers=2, watch_dir='.') # [source]
None
resume_session(handler, app) # [source]
.
require_auth(*allowed_roles) # [source]
None
enqueue(callable, *args, **kwargs) # [source]
append a function call to the end of the job queue
StandaloneServer(app, port) # [source]
A standalone gunicorn webapp context for the canopy.
Resource(**kwargs) # [source]
Application(name, db=True, args=None, model=None, static=None, icon=None, sessions=False, mounts=None, automount=False, autotemplate=False, wrappers=None, host=None, port=False) # [source]
A web application.
>>> app = Application("example") >>> @app.wrap ... def contextualize(handler, app): ... yield >>> @app.control(r"") ... class Greeting: ... def get(self): ... return "hello world"