backup page when site is broken

25 views
Skip to first unread message

Alex Glaros

unread,
May 19, 2019, 11:16:54 PM5/19/19
to web2py-users
how would I redirect to a plain static web page that displays "This Web2py app is temporarily down while we install updates"? Could I redirect to another site? Is there code to sense when site is broken then automatically redirects users?

I use pythonanywhere.com, redirect through a SSL service and my routes.py looks like:
#!/usr/bin/python
# -*- codingf-8 -*-
routers = dict(
    # base router
    BASE=dict(
        default_application='myDomain',
        domains={'www.myDomain':'myDomain'}
    ),
)

thanks,

Alex Glaros

Dave S

unread,
May 20, 2019, 4:04:37 AM5/20/19
to web2py-users
What's your front-end?  With nginx, I think I'd set it to server the 404 or Under Construction page from a static file.  You can also tweak your routes.py to do a similar thing, but the front end will be faster.

The Disable button on /admin/sites didn't seem to do anything on my home setup, W10 with 2.14.6 (yes, I know) and Rocket.  So I'm not sure what automatic provisions for site maintenance are supposed to be there.

/dps



Reply all
Reply to author
Forward
0 new messages