✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Microservices aproach with django and dash

Hello Dash community, i really need your help!

I created a project in django for the company i work for, it has multiple dash applications (library django-plotly-dash) and it has django authentication. It works great, but now, in order to deploy it, the IT team is telling me i need to somehow take a microservices aproach, because i’m planning to add more dashboards in the future and more users will use the app.

I created docker containers for Django, Nginx (static files and reverse proxy) and one of the dash apps, and i can just use an iframe in the Django templates to embed the dashboard like this:

iframe src=“http://host.docker.internal:8050” width=100%

The problem is the security, any user can just go directly to the port 8050 ignoring the django auth.

I’m not experienced in these topics, and after a lot of research i don’t have a clue in how to achieve this. The only similar thing i found is this:

do you think this could work with dash? or do you guys have a different idea?

Thanks a lot.

Is your ‘internal’ URL, ie the one on port 8050, served by django-plotly-dash in your Django app? If so, then you can use access control as described here

1 Like

I use that decorator on the ‘monolithic’ app, but with this new aproach now the dash is independent, i just have everything inside a container, not really ‘conected’. I think that could be a really good solution, the problem is, how can i serve the dash container inside django through the django-plotly-dash library?

Thank you!

Its not clear what you are trying to do. Are you using django-plotly-dash? If so then just run Django in a docker container. In this case there is no reason why you would want to run the Dash apps outside of Django.