Deploy to the web a Dash App with Diskcache

hi Render community members,
I would like to recommend to my community of ~30k Dash users on YouTube the usage of render instead of Heroku for Dash app deployment to the web.

I’ve deployed a Dash app twice through render’s free tier successfully.

However, when trying to deploy this current dash app that is running a background callback and diskcache, it gave me the following error.

File “/opt/render/project/src/.venv/lib/python3.7/site-packages/dash/long_callback/managers/”, line 40, in init
from missing_imports
ImportError: DiskcacheLongCallbackManager requires extra dependencies which can be installed doing
$ pip install “dash[diskcache]”

As you can see from the requirements.txt file, I declared dash[diskcache]==2.6.1, and this is the gunicorn start command I’m using: gunicorn app:server worker: celery app

The confusing thing is that I deployed the same repo/app successfully to the web using heroku’s free tier, so I’m not sure what needs to be updated for it to work with Render.

What about trying to include the dependencies for diskcache directly as per ?

John B

Thank you for this @John_B
I was able to deploy the app by adding these lines of code to the requirements file that you suggested:


That said, the app stops working after a few clicks on the background callback button. Do you know if one can run background workers on a free tier? Or could it be because “Disks are not supported for free plan services?”

You can’t run a background worker on a free plan, no. Webservices only.

John B

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.