refactor ara following some flask best practices

This commit refactors substantial chunks of ara's code:

- views.py is split up into multiple modules, and we use flask
  blueprints to avoid exposing the global app object to every module.

- all initialization happens in ara.webapp, which I've attempted to
  to make easy to manage as we add news views, filters, or other
  features.

- application configuration is now handled in a standard flask section
  (by using `app.config.from_object` and the existing `ara.config`
  module), with options for providing additional configuration via an
  argument to `create_app` or via an environment variable pointing at
  a Python file.

- The `playbook_host` view is gone, replaced with `playbook_results`,
  which can filter by either host or status or both via query
  parameters.

- Sorting has been moved from the views back into the controller

- The per-method decorator in the callback has been replaced by a
  metaclass that ensures we commit after each method.

- ara-manage has learned about the "createall" and "dropall" commands
  for explicitly creating or removing database tables.
This commit is contained in:
Lars Kellogg-Stedman
2016-05-19 23:01:12 -04:00
parent 1bb7d6ddff
commit 1b91fbf9a1
32 changed files with 545 additions and 300 deletions

View File

@@ -0,0 +1,7 @@
{% extends "layout.html" %}
{% block content %}
The resource you requested does not exist.
<div class="error">{{ error }}</div>
{% endblock %}