Debug log doesn't work

2013-02-15 Thread Shu Lin
Hi, The debug log in Pyramid doesn't work for dependent libraries suddenly. For example, even I enabled debug_authorization, there was no authorization log printed out anymore. Below is my development.ini Thanks a lot, -Shu [app:main] use = egg:crossbow_py reload_templates = true debug_au

Re: Return media files (such as jpg, png) in Response body other than String

2012-12-30 Thread Shu Lin
, December 30, 2012 6:13:39 PM UTC-8, Shu Lin wrote: > > Hi, > > If I have other objects other than String, which is holding a jpg or png > file, I like to return it as Response body, how can I do? > > I tried a piece of code like this: > > mimetype = image/png > b

Return media files (such as jpg, png) in Response body other than String

2012-12-30 Thread Shu Lin
Hi, If I have other objects other than String, which is holding a jpg or png file, I like to return it as Response body, how can I do? I tried a piece of code like this: mimetype = image/png body = fs.open(access_path, 'rb') return Response(body, content_type=mimetype) Here "body"