I read the web2py book's chapter on deployment recipes. My application is 
now compliant with
all efficiency tricks listed here:

http://web2py.com/books/default/chapter/29/13/deployment-recipes#Efficiency-tricks


I host my app at webfaction. I created a static-only app to serve the files 
from my app's static
folder and I created a .htaccess file to add a MIME type for javascript and 
set caching headers.


I have three apps dbModel containing all database and static files, init to 
just retrieve data and
cms to crud data. 

In init I set session.connect(request, response, masterapp='cms'). Am I 
right to conclude that now
sessions are only stored in admin and init app's sessions folder?

In the past I used a custom version of the expire_sessions.py file to clean 
up sessions. I called
the file from the Linux crontab:



I read the book's paragraph on cleaning up sessions but I am not sure 
whether I understand what I read correctly.

To delete expired sessions every 5 minutes I open an SSH session and enter:

nohup python ~/webapps/w2p/web2py/web2py.py -S admin -M -R 
scripts/sessions2trash.py
nohup python ~/webapps/w2p/web2py/web2py.py -S init -M -R 
scripts/sessions2trash.py

To delete session older than 60 minutes ... I add this to the crontab:

11,31,51 * * * * ~/webapps/w2p/web2py/web2py.py -S admin -R 
scripts/sessions2trash.py -A -o -x 3600 -f -v
12,32,52 * * * * ~/webapps/w2p/web2py/web2py.py -S init -R 
scripts/sessions2trash.py -A -o -x 3600 -f -v

Is that correct?


I don't want my users to be confronted with error tickets, but as admin I 
do want to know whether
the app in production does produce error tickets, so I had a look at:

http://web2py.com/books/default/chapter/29/04/the-core#Routes-on-error
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Collecting-tickets

I don't see how I combine these features to achieve what I want. I hope one 
of you can explain
me how to combine them.

Furthermore, I gave routes.py a try. I put this in web2py's root folder

routes_onerror = [
  ('init/*', '/init/default/error')
  ('cms/*', '/cms/default/error')
]

My first question is can I have:

routes_onerror = [
  ('init/*', '/init/default/error')
  ('init/smartapp/*', '/init/smartapp/error')
  ('cms/*', '/cms/default/error')
]

smartapp is a controller which views are ajax based. The view for 
init/default/error extends layout.html
the view for init/smartapp/error does not extend a view.

My second question, in development you do not use routes_onerror, do you?


I look forward to your answers,

Annet

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to