Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[svn] Fixed app globals issue, noticed by Matt Feifarek.

--HG--
branch : trunk
  • Loading branch information...
commit c252334cae3f26016556d4b3415e72804f5be20b 1 parent 74aa7a1
bbangert authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 docs/getting_started.txt
View
10 docs/getting_started.txt
@@ -81,7 +81,7 @@ We can test the template project like this::
cd helloworld
paster serve --reload development.ini
-Again Windows users may need a slightly longer version of the command with the path to their ``Scripts`` directory if they haven't followed the instructions in `Windows Notes <windowsnotes.txt>`_::
+Again Windows users may need a slightly longer version of the command with the path to their ``Scripts`` directory if they haven't followed the instructions in `Windows Notes <windowsnotes.html>`_::
python "C:\Python24\Scripts\paster" serve --reload development.ini
@@ -281,14 +281,16 @@ Here is an example of using the ``g`` variable. First modify your ``lib/app_glob
def __init__(self, defaults, app, **extra):
self.message = 'Hello'
-Then add this new method to the end of the ``helloworld/controllers/hello.py``:
+Then add this new method to the end of the ``helloworld/controllers/hello.py``::
def app_globals_test(self):
+ resp = Response()
if g.message == 'Hello':
- m.write(g.message)
+ resp.write(g.message)
g.message = 'Hello World!'
else:
- m.write(g.message)
+ resp.write(g.message)
+ return resp
This time if you run the server and visit http://127.0.0.1:5000/hello/app_globals_test/ you should see the message ``Hello``. If you visit the page again the message will be changed to ``Hello World!`` and it will remain changed for all subsequent requests because the application global variable was modified on the first request.
Please sign in to comment.
Something went wrong with that request. Please try again.