Aberrant/aberrant.py

23 lines
501 B
Python
Raw Normal View History

2019-01-16 09:33:36 -05:00
#!/usr/bin/env python3
"""
The primary module for serving the Aberrant application.
"""
from flask import Flask, render_template
2019-01-16 12:49:42 -05:00
import rtorrent
2019-01-16 09:33:36 -05:00
app = Flask(__name__)
2019-01-16 12:49:42 -05:00
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
app.jinja_env.undefined = "StrictUndefined"
2019-02-13 10:20:55 -05:00
rtorrent.get_all()
2019-01-16 09:33:36 -05:00
@app.route("/")
def index():
"""The index page."""
2019-01-16 12:49:42 -05:00
torrents = rtorrent.get_active()
2019-02-13 10:20:55 -05:00
return render_template("index.html", **locals())
2019-01-16 12:49:42 -05:00
2019-01-16 09:33:36 -05:00
if __name__ == "__main__":
2019-01-16 12:49:42 -05:00
app.run(host='0.0.0.0', port=5250)