<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Django integrate with Dropbox in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/726971#M32171</link>
    <description>&lt;P&gt;Hello everyone I met an issue with the Dropbox access token when I generated it on the Dropbox console app and used it in setting.py like this.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;MEDIA_URL = '/media/'&lt;/P&gt;
&lt;P&gt;MEDIA_ROOT = BASE_DIR / 'Media'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Store media files in Dropbox&lt;BR /&gt;DROPBOX_ACCESS_TOKEN = '&amp;lt;My_token&amp;gt;'&lt;/P&gt;
&lt;P&gt;STORAGES = {&lt;BR /&gt;"default": {&lt;BR /&gt;"BACKEND": "storages.backends.dropbox.DropboxStorage",&lt;BR /&gt;"OPTIONS": {&lt;BR /&gt;"access_token": DROPBOX_ACCESS_TOKEN,&lt;BR /&gt;},&lt;BR /&gt;},&lt;BR /&gt;"staticfiles": {&lt;BR /&gt;"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",&lt;BR /&gt;},&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;DROPBOX_ROOT_PATH = 'Media'&lt;/P&gt;
&lt;P&gt;DROPBOX_TIMEOUT = '100'&lt;/P&gt;
&lt;P&gt;DROPBOX_WRITE_MODE = 'add'&lt;/P&gt;
&lt;P&gt;Then I run the server and it raises me:&lt;/P&gt;
&lt;P&gt;Invalid setting 'access_token' for DropboxStorage&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Has anyone had the same issue as me?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2023 08:18:09 GMT</pubDate>
    <dc:creator>HADES</dc:creator>
    <dc:date>2023-11-06T08:18:09Z</dc:date>
    <item>
      <title>Django integrate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/726971#M32171</link>
      <description>&lt;P&gt;Hello everyone I met an issue with the Dropbox access token when I generated it on the Dropbox console app and used it in setting.py like this.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;MEDIA_URL = '/media/'&lt;/P&gt;
&lt;P&gt;MEDIA_ROOT = BASE_DIR / 'Media'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Store media files in Dropbox&lt;BR /&gt;DROPBOX_ACCESS_TOKEN = '&amp;lt;My_token&amp;gt;'&lt;/P&gt;
&lt;P&gt;STORAGES = {&lt;BR /&gt;"default": {&lt;BR /&gt;"BACKEND": "storages.backends.dropbox.DropboxStorage",&lt;BR /&gt;"OPTIONS": {&lt;BR /&gt;"access_token": DROPBOX_ACCESS_TOKEN,&lt;BR /&gt;},&lt;BR /&gt;},&lt;BR /&gt;"staticfiles": {&lt;BR /&gt;"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",&lt;BR /&gt;},&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;DROPBOX_ROOT_PATH = 'Media'&lt;/P&gt;
&lt;P&gt;DROPBOX_TIMEOUT = '100'&lt;/P&gt;
&lt;P&gt;DROPBOX_WRITE_MODE = 'add'&lt;/P&gt;
&lt;P&gt;Then I run the server and it raises me:&lt;/P&gt;
&lt;P&gt;Invalid setting 'access_token' for DropboxStorage&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Has anyone had the same issue as me?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 08:18:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/726971#M32171</guid>
      <dc:creator>HADES</dc:creator>
      <dc:date>2023-11-06T08:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Django integrate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/727015#M32172</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1762964"&gt;@HADES&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Just keep in mind that no any real Dropbox API call can be seen in the code you shared. Another thing is that all access tokens are short lived, so wherever you perform actual API calls it's likely to fail after some time (typically 4 hours). For long term access you need refresh token. If a supported SDK is in use just proper initialization is enough (for the rest SDK takes care), otherwise tracing access token validity and refresh whenever needed should be performed.&lt;/P&gt;&lt;P&gt;Hope this gives direction.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 12:46:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/727015#M32172</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-04T12:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Django integrate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/727409#M32174</link>
      <description>&lt;P&gt;I see Здравко already helpfully offered guidance on this, but for reference you can find more information about how this works on Dropbox at the following resources:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://developers.dropbox.com/oauth-guide" target="_blank"&gt;https://developers.dropbox.com/oauth-guide&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#authorization&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://dropbox.tech/developers/using-oauth-2-0-with-offline-access" target="_blank"&gt;https://dropbox.tech/developers/using-oauth-2-0-with-offline-access&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 06 Nov 2023 15:57:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/727409#M32174</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-11-06T15:57:08Z</dc:date>
    </item>
    <item>
      <title>Django intergate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/728467#M32227</link>
      <description>&lt;P&gt;Hello everyone some day ago I got and used Dropbox SDKs and their refresh token to upload files and images.&lt;BR /&gt;I setting like this:&amp;nbsp;&lt;BR /&gt;&amp;nbsp;# Setting for Dropbox&lt;BR /&gt;dbx = dropbox.Dropbox(&lt;BR /&gt;oauth2_refresh_token = My_token['refresh_token'],&lt;BR /&gt;app_key = My_token['app_key'],&lt;BR /&gt;app_secret = My_token['app_secret'],&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;with file_name.open('rb') as f:&lt;BR /&gt;dbx.files_upload(f.read(), f'/{file_name}')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I can upload my files and I can see my files locally: Apps/Media_django/{file_name}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;but now I need to store that link to display it in my case as images:&lt;BR /&gt;path = '/Apps/Media_django/{fiel_name}'&lt;BR /&gt;share_link_metadata = dbx.sharing_create_shared_link_with_settings(path)&lt;BR /&gt;url_avatar = share_link_metadata.url&lt;/P&gt;&lt;P&gt;and I get that path not found all the time when I try path= '/Media_django/{...}', or '/{...}' it still can not find my path&lt;BR /&gt;I need some help here.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 02:25:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/728467#M32227</guid>
      <dc:creator>HADES</dc:creator>
      <dc:date>2023-11-10T02:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Django intergate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/728479#M32228</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1762964"&gt;@HADES&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Glad to hear your upload is working already. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; Why do you use different path when you try get link? The path has to be the same one used on file upload or received on listing your containing folder. Don't assume something else, like what you see in your web browser or based on local Dropbox folder content! All paths for "App folder" app type are rooted in the app's automatically created own folder, not the entire account.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: In context of:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1762964"&gt;@HADES&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... it still can not find my path ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Evaluate the result of:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;listRes = dbx.files_list_folder('')&lt;/LI-CODE&gt;&lt;P&gt;... to see what you have there (in 'listRes'). &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 12:38:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/728479#M32228</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-10T12:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Django intergate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/732414#M32360</link>
      <description>&lt;P&gt;Thank you, I finally uploaded and got an image link to display for my application.&amp;nbsp;&lt;BR /&gt;My code for someone who wants to store image and display them:&amp;nbsp;&lt;BR /&gt;def upload_file(dbx, file, file_name):&lt;BR /&gt;with file.open('rb') as f:&lt;BR /&gt;dbx.files_upload(f.read(), f'/{file_name}')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Get and create url of image&lt;BR /&gt;def get_and_share_image(dbx, file_name):&lt;BR /&gt;# Query all files to get file_name&lt;BR /&gt;all_files = dbx.files_list_folder('').entries&lt;BR /&gt;for file in all_files:&lt;BR /&gt;if isinstance(file, dropbox.files.FileMetadata) and file.name == file_name:&lt;BR /&gt;&lt;BR /&gt;# Create avatar_url&lt;BR /&gt;generate_image_url = dbx.sharing_create_shared_link(file.path_lower)&lt;BR /&gt;image_url = generate_image_url.url&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2023 02:36:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/732414#M32360</guid>
      <dc:creator>HADES</dc:creator>
      <dc:date>2023-11-26T02:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Django intergate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/732648#M32370</link>
      <description>&lt;P&gt;Please note that calling only files_list_folder is not guaranteed to return all of the items in the specified folder. You should use both &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder" target="_blank"&gt;files_list_folder&lt;/A&gt; and &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder_continue" target="_blank"&gt;files_list_folder_continue&lt;/A&gt; to make sure you can retrieve all entries. Refer to the linked documentation for more information.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 15:31:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/732648#M32370</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-11-27T15:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Django intergate with Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/732653#M32372</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1762964"&gt;@HADES&lt;/a&gt;, You don't need listing at all. Just proper path formatting would be enough.&amp;nbsp; I proposed you list your folder just to see what's there - i.e. for debug - nothing more.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 15:37:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-integrate-with-Dropbox/m-p/732653#M32372</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-27T15:37:55Z</dc:date>
    </item>
  </channel>
</rss>

