This action allows to create a file report based on a template. You can use Jinja2 as your template engine.
In this example we will create a file called my_report.html when the monitor suite finishes:
# monitors.py
from spidermon.contrib.actions.reports.files import CreateFileReport
class DummyMonitorSuite(MonitorSuite):
monitors = [
DummyMonitor,
]
monitors_finished_actions = [
CreateFileReport,
]
# settings.py
SPIDERMON_REPORT_TEMPLATE = 'reports/email/monitors/result.jinja'
SPIDERMON_REPORT_CONTEXT = {
'report_title': 'Spidermon File Report'
}
SPIDERMON_REPORT_FILENAME = 'my_report.html'
Settings available:
Dictionary containing context variables to be included in your report.
String containing the path of the generated report file.
String containing the location of the template for the file report.
This action works exactly like File Report Action but instead of saving the generated report locally, it uploads it to a S3 Amazon Bucket.
Settings available: