<?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, unable to locate static files when using Dropbox in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-unable-to-locate-static-files-when-using-Dropbox/m-p/610763#M28248</link>
    <description>&lt;P&gt;I'm new to Django and I'm trying to understand the static and media files. I'm following &lt;A title="to" href="https://www.myskingym.co.uk/" target="_self"&gt;to&amp;nbsp;&lt;/A&gt;&lt;A href="https://testdriven.io/blog/storing-django-static-and-media-files-on-amazon-s3/" target="_blank" rel="nofollow noopener noreferrer"&gt;this practical example which uses AWS&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;As I don't have AWS but Dropbox, I used django-storages but with Dropbox instead of AWS.&lt;/P&gt;
&lt;P&gt;It works fine while storing the files locally. However, when pointing to Dropbox, I'm able to upload them but when loading the django app it fails as it does not find the icons.&lt;/P&gt;
&lt;P&gt;Dropbox folder structure is as follows:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Dropbox
&lt;UL&gt;
&lt;LI&gt;Aplicaciones
&lt;UL&gt;
&lt;LI&gt;ptstg
&lt;UL&gt;
&lt;LI&gt;bulma.min.css&lt;/LI&gt;
&lt;LI&gt;admin
&lt;UL&gt;
&lt;LI&gt;img
&lt;UL&gt;
&lt;LI&gt;icon1.jpg&lt;/LI&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;fonts
&lt;UL&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;css
&lt;UL&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;js
&lt;UL&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The value of my variables in SETTINGS are:&lt;/P&gt;
&lt;PRE&gt;DROPBOX_ROOT_PATH = &lt;SPAN class=""&gt;'/Aplicaciones/ptstg'&lt;/SPAN&gt;
DROPBOX_LOCATION = &lt;SPAN class=""&gt;'static'&lt;/SPAN&gt;
STATIC_FILES = &lt;SPAN class=""&gt;'staticfiles'&lt;/SPAN&gt;
STATIC_URL = &lt;SPAN class=""&gt;f'&lt;SPAN class=""&gt;{DROPBOX_LOCATION}&lt;/SPAN&gt;/'&lt;/SPAN&gt;
STATICFILES_STORAGE = &lt;SPAN class=""&gt;'storages.backends.dropbox.DropBoxStorage'&lt;/SPAN&gt;
DEFAULT_FILE_STORAGE = &lt;SPAN class=""&gt;'storages.backends.dropbox.DropBoxStorage'&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;I'm expecting to store and access the static and image files from the root folder /Aplicaciones/ptstg. And it does. However, it uploads all files into a folder called 'admin' with the icons inside&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;img&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder (same&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;img&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder name is used when locally, and it works).&lt;/P&gt;
&lt;P&gt;When I try to reload my site, it fails and it complain: Exception Value:&lt;/P&gt;
&lt;PRE&gt;ApiError(&lt;SPAN class=""&gt;'dea1242d617d4ef9a8b9afe5ab06fd97'&lt;/SPAN&gt;, GetTemporaryLinkError(&lt;SPAN class=""&gt;'path'&lt;/SPAN&gt;, LookupError(&lt;SPAN class=""&gt;'not_found'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;None&lt;/SPAN&gt;)))&lt;/PRE&gt;
&lt;P&gt;And it points to the following file: Error during template rendering in template&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;/usr/src/app/upload/templates/upload.html&lt;/EM&gt;, error at line 8&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;   {% load static %}
&lt;SPAN class=""&gt;2&lt;/SPAN&gt;   
&lt;SPAN class=""&gt;3&lt;/SPAN&gt;   &amp;lt;!DOCTYPE html&amp;gt;
&lt;SPAN class=""&gt;4&lt;/SPAN&gt;   &amp;lt;html&amp;gt;
&lt;SPAN class=""&gt;5&lt;/SPAN&gt;     &amp;lt;head&amp;gt;
&lt;SPAN class=""&gt;6&lt;/SPAN&gt;       &amp;lt;meta charset=&lt;SPAN class=""&gt;"utf-8"&lt;/SPAN&gt;&amp;gt;
&lt;SPAN class=""&gt;7&lt;/SPAN&gt;       &amp;lt;meta name=&lt;SPAN class=""&gt;"viewport"&lt;/SPAN&gt; content=&lt;SPAN class=""&gt;"width=device-width, initial-scale=1, shrink-to-fit=no"&lt;/SPAN&gt;&amp;gt;
&lt;SPAN class=""&gt;8&lt;/SPAN&gt;       &amp;lt;link rel=&lt;SPAN class=""&gt;"shortcut icon"&lt;/SPAN&gt; &lt;SPAN class=""&gt;type&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"image/png"&lt;/SPAN&gt; href=&lt;SPAN class=""&gt;"{% static 'images/favicon.png' %}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 21:21:45 GMT</pubDate>
    <dc:creator>jemes032</dc:creator>
    <dc:date>2022-07-25T21:21:45Z</dc:date>
    <item>
      <title>Django, unable to locate static files when using Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-unable-to-locate-static-files-when-using-Dropbox/m-p/610763#M28248</link>
      <description>&lt;P&gt;I'm new to Django and I'm trying to understand the static and media files. I'm following &lt;A title="to" href="https://www.myskingym.co.uk/" target="_self"&gt;to&amp;nbsp;&lt;/A&gt;&lt;A href="https://testdriven.io/blog/storing-django-static-and-media-files-on-amazon-s3/" target="_blank" rel="nofollow noopener noreferrer"&gt;this practical example which uses AWS&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;As I don't have AWS but Dropbox, I used django-storages but with Dropbox instead of AWS.&lt;/P&gt;
&lt;P&gt;It works fine while storing the files locally. However, when pointing to Dropbox, I'm able to upload them but when loading the django app it fails as it does not find the icons.&lt;/P&gt;
&lt;P&gt;Dropbox folder structure is as follows:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Dropbox
&lt;UL&gt;
&lt;LI&gt;Aplicaciones
&lt;UL&gt;
&lt;LI&gt;ptstg
&lt;UL&gt;
&lt;LI&gt;bulma.min.css&lt;/LI&gt;
&lt;LI&gt;admin
&lt;UL&gt;
&lt;LI&gt;img
&lt;UL&gt;
&lt;LI&gt;icon1.jpg&lt;/LI&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;fonts
&lt;UL&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;css
&lt;UL&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;js
&lt;UL&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The value of my variables in SETTINGS are:&lt;/P&gt;
&lt;PRE&gt;DROPBOX_ROOT_PATH = &lt;SPAN class=""&gt;'/Aplicaciones/ptstg'&lt;/SPAN&gt;
DROPBOX_LOCATION = &lt;SPAN class=""&gt;'static'&lt;/SPAN&gt;
STATIC_FILES = &lt;SPAN class=""&gt;'staticfiles'&lt;/SPAN&gt;
STATIC_URL = &lt;SPAN class=""&gt;f'&lt;SPAN class=""&gt;{DROPBOX_LOCATION}&lt;/SPAN&gt;/'&lt;/SPAN&gt;
STATICFILES_STORAGE = &lt;SPAN class=""&gt;'storages.backends.dropbox.DropBoxStorage'&lt;/SPAN&gt;
DEFAULT_FILE_STORAGE = &lt;SPAN class=""&gt;'storages.backends.dropbox.DropBoxStorage'&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;I'm expecting to store and access the static and image files from the root folder /Aplicaciones/ptstg. And it does. However, it uploads all files into a folder called 'admin' with the icons inside&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;img&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder (same&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;img&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder name is used when locally, and it works).&lt;/P&gt;
&lt;P&gt;When I try to reload my site, it fails and it complain: Exception Value:&lt;/P&gt;
&lt;PRE&gt;ApiError(&lt;SPAN class=""&gt;'dea1242d617d4ef9a8b9afe5ab06fd97'&lt;/SPAN&gt;, GetTemporaryLinkError(&lt;SPAN class=""&gt;'path'&lt;/SPAN&gt;, LookupError(&lt;SPAN class=""&gt;'not_found'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;None&lt;/SPAN&gt;)))&lt;/PRE&gt;
&lt;P&gt;And it points to the following file: Error during template rendering in template&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;/usr/src/app/upload/templates/upload.html&lt;/EM&gt;, error at line 8&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;   {% load static %}
&lt;SPAN class=""&gt;2&lt;/SPAN&gt;   
&lt;SPAN class=""&gt;3&lt;/SPAN&gt;   &amp;lt;!DOCTYPE html&amp;gt;
&lt;SPAN class=""&gt;4&lt;/SPAN&gt;   &amp;lt;html&amp;gt;
&lt;SPAN class=""&gt;5&lt;/SPAN&gt;     &amp;lt;head&amp;gt;
&lt;SPAN class=""&gt;6&lt;/SPAN&gt;       &amp;lt;meta charset=&lt;SPAN class=""&gt;"utf-8"&lt;/SPAN&gt;&amp;gt;
&lt;SPAN class=""&gt;7&lt;/SPAN&gt;       &amp;lt;meta name=&lt;SPAN class=""&gt;"viewport"&lt;/SPAN&gt; content=&lt;SPAN class=""&gt;"width=device-width, initial-scale=1, shrink-to-fit=no"&lt;/SPAN&gt;&amp;gt;
&lt;SPAN class=""&gt;8&lt;/SPAN&gt;       &amp;lt;link rel=&lt;SPAN class=""&gt;"shortcut icon"&lt;/SPAN&gt; &lt;SPAN class=""&gt;type&lt;/SPAN&gt;=&lt;SPAN class=""&gt;"image/png"&lt;/SPAN&gt; href=&lt;SPAN class=""&gt;"{% static 'images/favicon.png' %}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 21:21:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-unable-to-locate-static-files-when-using-Dropbox/m-p/610763#M28248</guid>
      <dc:creator>jemes032</dc:creator>
      <dc:date>2022-07-25T21:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Django, unable to locate static files when using Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-unable-to-locate-static-files-when-using-Dropbox/m-p/610878#M28250</link>
      <description>&lt;P&gt;A 'path/not_found' error like this indicates that there was nothing found in the connected account at the path specified for that API call. To troubleshoot this, I recommend you print out the full exact 'path' value that you're sending for that call. You'll need to make sure that value exactly matches the path in the account for the file you're trying to access. If you're uploading to one path and then trying to download that later, you'll need to make sure those paths match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that if you're using an access token for an app with the "full Dropbox" &lt;A href="https://www.dropbox.com/developers/reference/developer-guide#app-permissions" target="_blank"&gt;access type&lt;/A&gt;, you should specific the full path, e.g., including '/Aplicaciones/ptstg' when applicable, but if you're using an access token for an app with the "app folder" access, you should omit the app folder path components "/Aplicaciones/ptstg', as API calls will operate from that root automatically.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 15:12:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Django-unable-to-locate-static-files-when-using-Dropbox/m-p/610878#M28250</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-07-20T15:12:40Z</dc:date>
    </item>
  </channel>
</rss>

