Skip to content

Commit

Permalink
Merge pull request web2py#1504 from vinyldarkscratch/master
Browse files Browse the repository at this point in the history
Updated and functional version of web2py#1420
  • Loading branch information
mdipierro authored Oct 14, 2016
2 parents 77968b5 + 63c494c commit 77dfec9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions applications/examples/static/503.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body><h1>Temporarily down for maintenance</h1></body></html>
1 change: 1 addition & 0 deletions applications/welcome/static/503.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body><h1>Temporarily down for maintenance</h1></body></html>
6 changes: 5 additions & 1 deletion gluon/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ def wsgibase(environ, responder):
% 'invalid request',
web2py_error='invalid application')
elif not request.is_local and exists(disabled):
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
five0three = os.path.join(request.folder,'static','503.html')
if os.path.exists(five0three):
raise HTTP(503, file(five0three, 'r').read())
else:
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")

# ##################################################
# build missing folders
Expand Down

0 comments on commit 77dfec9

Please sign in to comment.