How can python generate Dorpbox auth tokens after expire?

In my python website, I added dropbox refresh token, App key and Secret key. And in settings.py file I generate access token from these details. Now, my question is that how it will get new auth token after refresh token after expire it . Settings.py loads only one time when build is done and project starts. after expire token, it giving errors.

Apps using the Dropbox API can get long-term access by requesting "offline" access, in which case the app receives a "refresh token" that can be used to automatically retrieve new short-lived access tokens as needed, without further manual user intervention. The refresh tokens themselves do not expire.

The Dropbox SDKs can handle this automatically for you. For the official Dropbox Python SDK, you can find examples of this flow at the following links:

Otherwise, if you're not using a Dropbox SDK, refer to the following resources for information on how to implement this process in your code:

Back to Top