Template rendered html email for Web2py email verification and password reset

For discussion about this old problem, read Google group thread here. I ended up modifying gluon/tools.py. It is probably not a good practice. But it is the easiest solution. I edit register() and email_reset_password() modifying something like (depends on which one) message=self.messages.verify_email % d to message=(”,response.render(’email/template.html’, d)) Be careful with the ending parentheses, the two […]

Force SSL/HTTPS and non-www in web2py

Update 02.08.2018: Code is updated to use just one line to force https: request.requires_https() ======= I read this https://groups.google.com/forum/#!topic/web2py/RzJ4pYtAWF4 and https://stackoverflow.com/questions/26802850/pythonanywhere-web2py-redirect-to-https then I realized “cronjob” problem described in these answers are no longer relevant since `scheduler` has long since replaced `cron` I created a new model secure.py and add: ########## FORCED SSL non-www ########## session.secure() […]

Securing Web2py with Let’s Encrypt / Certbot

In case anybody wondering the same question about using certbot/let’s encrypt and web2py: how do you serve the .well-known folder for certification, when all the request goes to wsgi handler? 1. use `–standalone` as David advised. But you have to stop the web server every time you renew. 2. instead, you can use the standard […]

Passenger WSGI setup with pyenv on Dreamhost for Web2Py

Update 2019.12.06: I have moved from DreamHost to Google Cloud VPS. If this post does not work for you, please see alternative method in a comment by Chris. I have been using fastcgi+flup (link) to run my web2py apps on shared Dreamhost hosting. But the speed was really mediocre. Dreamhost recommends Passenger WSGI for python […]