Custom maintenance message

83 views
Skip to first unread message

Yoel Benitez Fonseca

unread,
Oct 20, 2017, 12:04:58 PM10/20/17
to web2py
hi !

How can i make a custom 'Temporarily down for maintenance' page ?

--
Msc. Yoel Benítez Fonseca
Dpto. Informática. Redacción Adelante
http://www.adelante.cu/

Yoel Benitez Fonseca

unread,
Oct 20, 2017, 1:05:34 PM10/20/17
to web2py
Nerver mind ... i have found app/static/503.html

now ¿how to include images and souch ?

Dave S

unread,
Oct 20, 2017, 2:55:08 PM10/20/17
to web2py-users


On Friday, October 20, 2017 at 10:05:34 AM UTC-7, Yoel Benitez Fonseca wrote:
Nerver mind ... i have found app/static/503.html

now ¿how to include images and souch ?

Just put those images in app/static (like the FB and Twitter logos), and add a <IMG src= ... />
in your 503.html file.

/dps
 

黄祥

unread,
Oct 20, 2017, 9:42:17 PM10/20/17
to web2py-users
i just interest for modif the 404 error not found, when trying to modif static/404.html, the result is not expected (no error traceback occur)
e.g.
static/404.html
<html><body><h1>this page doesn't exist</h1></body></html>

result

invalid controller (123/index)


expected result
this page doesn't exist

any idea to achieve it using web2py way? using routes maybe or controllers?

thanks and best regards,
stifan

Dave S

unread,
Oct 21, 2017, 2:47:39 AM10/21/17
to web2py-users
Routes.py and applications/myapp/routes.py,
but I don't have a complete answer yet.  
(The complete answer is documented in the sample route.py files, but I haven't absorbed all that yet.)

thanks and best regards,
stifan

/dps
 

黄祥

unread,
Oct 21, 2017, 3:17:53 AM10/21/17
to web2py-users
learn from anthony respond in stackoverflow it is in routes.py in web2py root folder not in app root folder (tested using routes.py in app root folder is not work, no error occured but the result is not expected)
e.g. (replace web2pyapp with your web2py application name)
cd ~/web2py/
cp examples/routes.parametric.example.py ./routes.py
echo "routes_onerror = [('web2pyapp/404', '/web2pyapp/static/404.html') ]" >> routes.py

you can choose either : 
to put in web2py root folder tested both work fine

Dave S

unread,
Oct 23, 2017, 5:27:03 AM10/23/17
to web2py-users


On Saturday, October 21, 2017 at 12:17:53 AM UTC-7, 黄祥 wrote:
learn from anthony respond in stackoverflow it is in routes.py in web2py root folder not in app root folder (tested using routes.py in app root folder is not work, no error occured but the result is not expected)

I'm not sure that that is what Anthony said in the SO reply.

But as I understand it, the app/routes.py doesn't work if you don't have the base routes.py set up.
 
e.g. (replace web2pyapp with your web2py application name)
cd ~/web2py/
cp examples/routes.parametric.example.py ./routes.py
echo "routes_onerror = [('web2pyapp/404', '/web2pyapp/static/404.html') ]" >> routes.py

you can choose either : 
to put in web2py root folder tested both work fine


thanks and best regards,
stifan

/dps
 
Reply all
Reply to author
Forward
0 new messages