Black Lives Matter. Please consider donating to Black Girls Code today.
Dash Enterprise delivers an incredible 21x cost savings 💸Download the e-book!

DashApp Loading inside Django

I am using dash inside a django application.
Inside a DetailView a dash app is loaded.
Integration is done with:

Locally it works fine.

Deployed to Google Cloud flexible App engine loading the page
somtimes the dash app in side the page is loading sometimes not.
Looking at the HTML source of the embedded iframe the content is:

<div id="react-entry-point">
<div class="_dash-loading">
Loading Django-Plotly-Dash app

It seems django is returning the page while dash inside is still loading?
Any ideas?

Are you in a position to look at a console in the browser and see if all the requests are going to the right URL and are getting a response?

In the problem cases i get for example
POST https://URL/django_plotly_dash/app/Ticker/initial/dpd-initial-args-616cde80a7ba49b9ba5661f9b4db8ead//_dash-update-component 404

The dash app is embeded in the template with
{%plotly_app initial_arguments=my_dict ratio=0.65 name=“Ticker” %}
the initial_arguments is an article number which is given to a invisible div

html.Div(id=‘artnum’, style={‘display’: ‘none’})

the callback hadlers use this article numer to display a graph.

Is that POST request different - other than the ‘URL’ part - to the version you have working outside of the app engine?
The // before _dash-update-component looks a bit suspicious, for example.

The souce of the iframe at the local machine:

At the Google cloud:

Almost identical.
Both have a // at the end of the src

Calling the local url of the emeded app directly in the Browser
i can reproduce the error locally:

dash_renderer.min.js:1 POST 404 (Not Found)

Thanks, based on that information and also on ‘sometimes … is loading sometimes not’ from your original post makes me think that this is something subtle to do with the app engine environment. I would suggest one or both of (a) trying again, using the latest version of django-plotly-dash if you haven’t already, and (b) reporting the issue on the project’s github page

I identified the problem. I am loading the app with django-plotly-dash. I give as initial argument a number (an article number of the article to display) to the dash app and write it to a DIV.
Sometimes the number is not given to the dash app. It seems to be an issue of loading time of django and dash.

So can you explain how did you finally solve it because i am facing the same problem!