These are chat archives for django/django
@fsecada01 I found the problem, not matter the static url, I can visit the url
http://ip:port/media/xxx.mp4correctly. the problem is I will get a url what is "http://ip:port/media/media/xxx.mp4". when I use django admin backend to upload a file with
models.FileFieldof django.model it'll return a url without "/" for instance, I upload a file xxx.mp4, then it'll return "media/xxx.mp4", that url dosen't work on django. correct url should be "/media/xxx.mp4", that will work.
from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # ... the rest of your URLconf goes here ... ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)