Permalink
Browse files

* Add sessions to documentation (#3).

  • Loading branch information...
1 parent 1f0814a commit 7728147f7012def7a03aa98978bc167b8c3000a1 @breily committed Mar 25, 2009
Showing with 14 additions and 1 deletion.
  1. +13 −0 doc/3-requests_and_responses.md
  2. +1 −1 doc/build.py
@@ -15,6 +15,7 @@ If 'web' is a JunoRequest object created from an actual request:
web.full_location # '/?a=4'
web.user_agent # ...user-agent string...
web.raw # A dictionary mapping header names to their values
+ web.session # A session object, if 'use_sessions': True
web['REQUEST_URI'] # The Request can be used like a dictionary, to
# retrieve values from the raw dictionary.
@@ -37,6 +38,17 @@ sharing a name), they values are put in a list:
web.input('b') # => ['1', '2'] for '?b=1&b=2'
+To use sessions, be sure to install [Beaker][beaker], and set 'use_sessions'
+to True. Sessions are used like a dictionary:
+
+ web.session['foo'] = 'bar'
+ web.session.save() # save() must be called
+
+You then can access 'foo' later on:
+
+ web.session['foo'] # => 'bar'
+
+
Response Basics
---------------
@@ -111,3 +123,4 @@ Serving static files with Juno involves 3 configuration options:
The built in static handler will automatically determine mimetypes for
you, and will return a 404 if the file cannot be found.
+[beaker]: http://wiki.pylonshq.com/display/beaker/Home
View
@@ -1,6 +1,6 @@
import sys,os,glob,re
import markdown
-print sys
+
dir = os.path.dirname(sys.argv[0]) or '.'
os.chdir(dir)
for f in glob.glob('*.md') + glob.glob('*.txt'):

0 comments on commit 7728147

Please sign in to comment.