parent
2b3e4f8d72
commit
9800030201
4 changed files with 66 additions and 46 deletions
12
web_view.py
12
web_view.py
|
|
@ -16,6 +16,7 @@ import yaml
|
|||
|
||||
import agenda.data
|
||||
import agenda.error_mail
|
||||
import agenda.thespacedevs
|
||||
import agenda.travel
|
||||
|
||||
app = flask.Flask(__name__)
|
||||
|
|
@ -61,6 +62,17 @@ async def index() -> str:
|
|||
return flask.render_template("index.html", today=now.date(), **data)
|
||||
|
||||
|
||||
@app.route("/launches")
|
||||
async def launch_list() -> str:
|
||||
"""Web page showing List of space launches."""
|
||||
now = datetime.now()
|
||||
data_dir = app.config["DATA_DIR"]
|
||||
rocket_dir = os.path.join(data_dir, "thespacedevs")
|
||||
rockets = await agenda.thespacedevs.get_launches(rocket_dir, limit=100)
|
||||
|
||||
return flask.render_template("launches.html", rockets=rockets, now=now)
|
||||
|
||||
|
||||
@app.route("/gaps")
|
||||
async def gaps_page() -> str:
|
||||
"""List of available gaps."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue