Files
notifications-admin/app.py

22 lines
670 B
Python
Raw Normal View History

2015-11-23 13:50:37 +00:00
import os
from flask.ext.script import Manager, Server
from flask_migrate import Migrate, MigrateCommand
2016-01-27 16:32:40 +00:00
from app import create_app
2015-11-23 13:50:37 +00:00
2015-11-24 09:40:14 +00:00
application = create_app(os.getenv('NOTIFICATIONS_ADMIN_ENVIRONMENT') or 'development')
manager = Manager(application)
port = int(os.environ.get('PORT', 6012))
manager.add_command("runserver", Server(host='0.0.0.0', port=port))
2016-01-27 16:32:40 +00:00
2015-11-23 13:50:37 +00:00
@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))
2015-11-23 13:50:37 +00:00
2015-11-23 14:55:37 +00:00
if __name__ == '__main__':
manager.run()