On Jul 15, 2007, at 10:25 AM, voltron wrote:
That worked, the project starts now. Is there some documentation somewhere that I can read about how things are to done with this new version? For example:1. Using SAContext with 0.96
The latest SAContext works fine, and I believe 0.2.1 also worked ok.
2. using the Global config object
Instead of looking for app_config['something'], or using the CONFIG ['somekey'] from paste.deploy, you can just use:
from pylons import config sadburi = config['sqlalchemy.dburi']This works whether your application is answering a response, and it works as soon as you load your WSGI app (ie, in a shell script). So your config info is in the same place in either case (it wasn't before 0.9.6).
3. Using the Global response object
There's now a pylons.response global object. Just add headers or cookies, or change the content type of it, and have your controller return a string. So instead of:
return render_response('/some/template.html')
It's just:
return render('/some/template.html')
The headers and cookies from the global response object will be sent
out. This means you can also write functions elsewhere that use the
response global to set headers and they'll *just work*, rather than
having to try and pass the Response object around to add things to
the response.
4. How to use HTTPExceptions in a controller
Same as before, just abort(404) or how you were doing it before. If its a 3XX status code, cookies will still be retained from the global response object as well.
Cheers, Ben
smime.p7s
Description: S/MIME cryptographic signature
