GitHub Dash Tutorial Book - Render Deploying Web Apps Issues

Hi There

I am currently working my way through GitHub Dash Tutorial Book and am stuck on Chapter 5 (Chapter 5 - App Deployment — Dash Tutorial).

I am trying to deploy my App using Render, however I keep on getting a Status: Failed. I have taken a look at the log output, and I think (to my novice eyes) this is the error:

INFOAttributeError: ‘Flask’ object has no attribute ‘before_first_request’. Did you mean: ‘_got_first_request’?

I am using Dash 2.7.0 and Flask 2.2.5. I can’t seem to fix this error myself. I would appreciate it if anyone has any advice that might help me understand what is going wrong, and how I can fix it, to aid my learning journey :slight_smile:

TIA

hi @Daffodil
:wave: welcome to the community.

I’ve never experienced that error, so I’m not sure what’s going on.

I found this video tutorial about deploying a Dash app on Render very helpful.

Thanks @adamschroeder I will take a look!

Hi @Daffodil

Have you tried to update your dash version?
It seems that before_first_request was deprecated in Flask (python - Flask deprecated before_first_request how to update - Stack Overflow).
And also that something was done in Dash about it ([BUG] Deprecation Warning in Flask 2.2 (before_first_request) · Issue #2177 · plotly/dash · GitHub and removed deprecated before_first_request by AnnMarieW · Pull Request #2265 · plotly/dash · GitHub).

I work with Dash 2.11.0 and Flask 2.2.5. Maybe you can try this combination.

@spriteware - thanks for the tip. I’m going to have a go at trying to fix it later today.

I have watched the You Tube video and also tried various Dash and Flask combinations - but nothing seems to be working for me. I’ve spent several hours trying to fix - however having no luck.

If anyone knows of a solution, please do let me know as this one has beaten me!