my app is online, static files worked perfect.
The upload from mediafiles worked perfect too, but there is no chance to serve them on the template.
I read a lot of posts, lot of blogs, but no success. Has anyone an idea?
thx for help.
settings.py
...
STATIC_URL = "static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
STATICFILES_DIRS = [
BASE_DIR / "static"
]
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
fly.toml:
...[[vm]]
memory = '4gb'
cpu_kind = 'shared'
cpus = 2
[[statics]]
guest_path = '/code/static'
url_prefix = '/static/'
[mounts]
source="media_dir"
destination="/code/media"
uls.py:
...
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)