>
> Note, aside from adding a few lines in the admin app to have its sessions 
> stored in the db, another option might be to edit the handler file used to 
> start web2py. In that file, you should be able to do something like this:
>
> from gluon.settings import global_settings
> global_settings.db_sessions = True
>

This does not work because db_sessions is only considered if 
response.session_storage_type 
== 'db' (i.e. if the db attribute is set in session.connect(...)).
Admin uses the default session.connect(...) so it does not set a db to 
store sessions into. Global settings won't change that (sadly).

The only reason why admin *does* store sessions in db on GAE is this 
snippet of code in its models (access.py):

if request.env.web2py_runtime_gae:

   session_db = DAL('gae')

   session.connect(request, response, db=session_db)


Storing tickets in db with request.tickets_db sounds nead but as you 
mentioned, it can't be done on Heroku because of the ephemeral filesystem.

My solution so far was to build a custom application on which all errors 
are routed (using routes_onerror). I built some code (largely based on 
scripts/tickets2email.py) to render tickets into html emails that are sent 
directly to app administrators when an error 500 is hit.

The reason for this is that the ephemeral system on Heroku can be reset 
randomly at any given time, so sending tickets through the bundled script 
would sometimes send "ticket missing" emails.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to