This repository has been archived by the owner on Apr 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from NERSC/19-07
19 07
- Loading branch information
Showing
12 changed files
with
67 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
basemap | ||
beautiful-soup | ||
beautifulsoup4 | ||
biopython | ||
netcdf4 | ||
notebook=5.7.8 | ||
notebook | ||
r-car | ||
r-essentials | ||
rpy2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ blaze | |
jupyter | ||
jupyterlab | ||
netcdf4 | ||
notebook=5.7.8 | ||
notebook | ||
r-essentials | ||
rpy2 | ||
scipy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import os | ||
|
||
from flask import Flask, render_template | ||
from sanic import Sanic | ||
from sanic.response import html | ||
|
||
app = Flask(__name__) | ||
from jinja2 import Environment, PackageLoader | ||
|
||
@app.route('/', defaults={'path': ''}) | ||
env = Environment(loader=PackageLoader('app', 'templates')) | ||
|
||
app = Sanic(__name__) | ||
app.static("/static", "./static") | ||
|
||
@app.route('/') | ||
@app.route('/<path:path>') | ||
def catch_all(path): | ||
async def catch_all(request, path=""): | ||
default_message = "NERSC's Jupyter service is offline. It will return when maintenance is over. Please try again later." | ||
message = os.environ.get("MESSAGE", default_message).strip() | ||
if not message: | ||
message = default_message | ||
return render_template("index.html", message=message), 503 | ||
template = env.get_template("index.html") | ||
content = template.render(message=message, app=app) | ||
return html(content, status=503) | ||
|
||
if __name__ == '__main__': | ||
app.run(host="0.0.0.0") | ||
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters