Package: tom-alerts-dash
tom_alerts_dashThis module supplements thetom_alertsmodule withPlotly Dashsupport for more responsive broker views.InstallationInstall the module into your TOM environment:pip install tom-alerts-dashAddtom_alerts_dashanddjango_plotly_dash.apps.DjangoPlotlyDashConfigto theINSTALLED_APPSin your TOM'ssettings.py:INSTALLED_APPS=['django.contrib.admin',...'tom_dataproducts','tom_alerts_dash','django_plotly_dash.apps.DjangoPlotlyDashConfig']AddSTATIC_ROOT = os.path.join(BASE_DIR, '_static')and the followingSTATICFILES_FINDERSconfiguration to yoursettings.py, ideally in theStatic files (CSS, JavaScript, Images)section:STATIC_URL='/static/'STATIC_ROOT=os.path.join(BASE_DIR,'_static')MEDIA_ROOT=os.path.join(BASE_DIR,'data')MEDIA_URL='/data/'STATICFILES_FINDERS=['django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder','django_plotly_dash.finders.DashAssetFinder','django_plotly_dash.finders.DashComponentFinder','django_plotly_dash.finders.DashAppDirectoryFinder',]Adddjango_plotly_dash.middleware.BaseMiddlewaretoMIDDLEWAREin yoursettings.py:MIDDLEWARE=['django.middleware.security.SecurityMiddleware',...'django_plotly_dash.middleware.BaseMiddleware','tom_common.middleware.Raise403Middleware',...]Add the following Django Plotly Dash configuration to yoursettings.py:# django-plotly-dash configurationX_FRAME_OPTIONS='SAMEORIGIN'PLOTLY_COMPONENTS=[# Common components'dash_core_components','dash_html_components','dash_renderer',# django-plotly-dash components'dpd_components',# static support if serving local assets# 'dpd_static_support',# Other components, as needed'dash_bootstrap_components','dash_table']Add the following two new paths to your baseurls.py:url_patterns=[path('alerts/',include('tom_alerts_dash.urls',namespace='tom_alerts_dash')),path('',include('tom_common.urls')),path('django_plotly_dash/',include('django_plotly_dash.urls')),]Please note that the path with the namespacetom_alerts_dashMUST be placed above thetom_common.urlsin order to properly override the defaulttom_alertspaths.Finally, run the following to run thedjango-plotly-dashmigrations:./manage.py migrateUsing SCIMMA with tom_alerts_dashThetom_scimmarepoalso includestom_alerts_dashsupport. To install it into a TOM withtom_alerts_dashconfigured, the following steps are required.Installtom_alerts_dashwith thetom_scimmadependency, in either of the following fashions:pip install tom_alerts_dash tom_scimmaor:pip install tom_alerts_dash[scimma]Add theTOM_ALERT_DASH_CLASSESsetting to yoursettings.py, along with the brokers that you want to include in your TOM:TOM_ALERT_DASH_CLASSES=['tom_alerts_dash.brokers.mars.MARSDashBroker','tom_alerts_dash.brokers.alerce.ALeRCEDashBroker','tom_alerts_dash.brokers.scimma.SCIMMADashBroker']Add the SCIMMA settings specified in thetom_scimmaREADME:TOM_ALERT_CLASSES=[...'tom_scimma.scimma.SCIMMABroker']BROKERS={...'SCIMMA':{'url':'http://skip.dev.hop.scimma.org','api_key':os.getenv('SKIP_API_KEY',''),'hopskotch_url':'dev.hop.scimma.org','hopskotch_username':os.getenv('HOPSKOTCH_USERNAME',''),'hopskotch_password':os.getenv('HOPSKOTCH_PASSWORD',''),'default_hopskotch_topic':''}}Creating a custom Dash broker moduleFor information on writing your own Dash broker module, please see theTOM Toolkit documentationon Dash broker modules.