The company were I work is building a website that is supposed to show some graphs and statistics. The front-end is written in angular and the back-end in python.
I would like to use dash to create the plots but I’m having a hard time displaying my test dash app. In the front end there is a button ‘draw graph’ that when pressed should open a new window with where the app is shown. I tried following the django-plotly-dash tutorial but for some reason I cannot make it work. I’m relatively new to django btw.
I have a graph app in the django project. My testing dash app is in dash_app.py and it contains a button that does nothing.
from dash import html
from django_plotly_dash import DjangoDash
app = DjangoDash("Test")
app.layout = html.Div([html.Button("Submit", id="submit-value")])
My template is dash_template.html
<!DOCTYPE html>
<html>
<head>
<title>Dashboard</title>
{%load plotly_dash%}
</head>
<body>
<h1>Dashboard Test</h1>
{%plotly_app name="Test" %}
</body>
</html>
And the views.py looks like this.
def dash_view(request):
return render(request, "graph/dash_template.html")
When I click the the draw_graph button, the new window opens and the header Dashboard Test is displayed but the Submit button does not appear.
I have already added path("django_plotly_dash/", include("django_plotly_dash.urls"))
to the project urls.py file and django_plotly_dash.apps.DjangoPlotlyDashConfig
to the INSTALLED_APPS
list.
Something to add is that when I open the developer mode in the window where the dash app is supposed to be displayed this error appears in the console:
ERROR Error: NG04002: Cannot match any routes. URL Segment:
‘django_plotly_dash/app/Test’
Angular 3
RxJS 3 core.mjs:6531:22
Angular 2
RxJS 6
Angular 10
Do you know what I’m doing wrong?
Thanks in advance.