I'm new to Django and I'm trying to understand the static and media files. I'm following to this practical example which uses AWS As I don't have AWS but Dropbox, I used django-storages but with Dropbox instead of AWS.
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.
Dropbox folder structure is as follows:
The value of my variables in SETTINGS are:
DROPBOX_ROOT_PATH = '/Aplicaciones/ptstg'
DROPBOX_LOCATION = 'static'
STATIC_FILES = 'staticfiles'
STATIC_URL = f'{DROPBOX_LOCATION}/'
STATICFILES_STORAGE = 'storages.backends.dropbox.DropBoxStorage'
DEFAULT_FILE_STORAGE = 'storages.backends.dropbox.DropBoxStorage'
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 img folder (same img folder name is used when locally, and it works).
When I try to reload my site, it fails and it complain: Exception Value:
ApiError('dea1242d617d4ef9a8b9afe5ab06fd97', GetTemporaryLinkError('path', LookupError('not_found', None)))
And it points to the following file: Error during template rendering in template /usr/src/app/upload/templates/upload.html, error at line 8
1 {% load static %}
2
3 <!DOCTYPE html>
4 <html>
5 <head>
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8 <link rel="shortcut icon" type="image/png" href="{% static 'images/favicon.png' %}