-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plotly_direct #496
Comments
That tag doesnt support the use of initial arguments, as per the documentation Is there a particular reason you can't use another tag, such as Alternatively, you could create (or update, as appropriate) an instsance of a DashApp in your view and directly render it; this object contains the current state and so can be set to hold whatever values you wish to set. |
but in my project I have 5 dash Apps integrated in 5 html templates, each app displays the data of the user that login with email and password, So there exist a lot of details , a lot of Apis used in each part of the app and the reason that i do not prefer |
Or what do you mean by updating an instance of the dash app direclty in views?
|
@BatoolGasser getting that data is probably best separated out (if the URL is constant then it never changes; if it does change then presumably it depends on the current user/session/request; either way it is likely one or other of the cache and ORM are the best places for it). Once you've got it somewhere, you can then use the information. If its available through the current user session or similar, then an extended callback provides access to the Django request. |
how can i get data from django template into dash app that integrated into it
this is the html template:
this is views.py:
def student_performance_display(request):
cards_data = requests.get("http://127.0.0.1:8000/cards/ab33da02-c725-4f47-85dc-7908374b267c").json()
context = {
'passed_hours': cards_data[0]['passed_hours'],
'cummulative_gpa': cards_data[0]['cummulative_gpa']
}
return render(request, 'home/student/student_performance.html', context)
The text was updated successfully, but these errors were encountered: