Archipelago/WebHostLib/landing.py

11 lines
441 B
Python
Raw Normal View History

2020-07-04 21:50:18 +00:00
from flask import render_template
from WebHostLib import app, cache
from .models import *
from datetime import timedelta
2020-07-04 21:50:18 +00:00
@app.route('/', methods=['GET', 'POST'])
@cache.cached(timeout=300) # cache has to appear under app route for caching to work
2020-07-04 21:50:18 +00:00
def landing():
multiworlds = count(room for room in Room if room.creation_time >= datetime.utcnow() - timedelta(days=7))
return render_template("landing.html", multiworlds=multiworlds)