Files
notifications-admin/app.py
Chris Hill-Scott 5c49c08db7 Rename imports to get rid of deprecation warnings
These imports have moved. One day importing them by the old name will
stop working. For now they just leave a warning in our logs. But better
not to have those warnings in our logs.
2017-07-27 15:17:17 +01:00

21 lines
555 B
Python

import os
from flask_script import Manager, Server
from app import create_app
application = create_app()
manager = Manager(application)
port = int(os.environ.get('PORT', 6012))
manager.add_command("runserver", Server(host='0.0.0.0', port=port))
@manager.command
def list_routes():
"""List URLs of all application routes."""
for rule in sorted(application.url_map.iter_rules(), key=lambda r: r.rule):
print("{:10} {}".format(", ".join(rule.methods - set(['OPTIONS', 'HEAD'])), rule.rule))
if __name__ == '__main__':
manager.run()