Using templates on Render

Hello, all

I searched here and there for an explanation why the dcc.Graph in my Render deployment do not benefit from the templates loaded by the method load_figure_template in dash_bootstrap_templates. It works just fine in the offline development environment though.
I’d imagine I overlooked some deployment setting.

How it looks in development:

How it looks on Render:

Any help is appreciated!

Thanks in advance.

I reached out to Render support and it was suggested I used the theme in load figure template in lower case (because it can make a difference in Linux, which is the base for Render virtual machines. Unfortunately that did not solve the issue.

Neither load_figure_template("slate") nor load_figure_template("SLATE") work.

I’m not giving up yet.

Hi @AzielFreitas

I’m guessing it’s an issue with dependencies. Check the versions used on Render vs what you have locally - specifically look for differences in dash, plotly, dash-bootstrap-components, and dash-bootstrap-templates.

Are there any errors in the logs on Render?

Another thing to try locally — create a new virtual environment and install the dependencies in the same way as it’s specified in Render. Check that correct version of each package are installed and didn’t resolve to other versions because of conflicts. Run your app in this environment and be sure to run with app.run(debug=True) to check for errors. Also look in the browser console for any errors that may not show up in the dash dev-tools.

If your code is public, sharing your GitHub, or make a minimal example in GitHub might be helpful as well.

Glad you aren’t giving up :slight_smile: I’ve seen other apps on Render using dash-bootstrap-templates

Hi AnnMarieW, thank you very much for dropping by!

That was insightful, I will sure incorporate your recommendations during my practices!
There was nothing wrong in the logs. I checked for the versions of the packages installed, and they were all matching my requirements.txt.
I must confess that part of my mistake was… kind of… developing on Windows :sweat_smile:
In the meantime I posted here I also sought help on Render. There, a kind soul mentioned:

“you probably should use load_figure_template("slate") instead of load_figure_template("SLATE")”.



..
.
That’s what I deserve for relying on AI too much to help me build my code blocks… unaware of Windows permissiveness…

Case closed. Thank you very much!

Glad you got it working! Looks great :tada: