These are chat archives for django/django

Nov 2018
Himanshu Shankar
Nov 12 2018 18:11
@sharifanani I don’t think commenting on any Open Source code should be an issue. Just create a parallel case scenario. Your employer owns everything you create using Django but they don’t own Django. You can contribute to FOSS. This, ofcourse, depends largely on your agreement i.e. if you’re allowed to contribute on Open Source code or not.
@fsecada01 I found the problem, not matter the static url, I can visit the url http://ip:port/media/xxx.mp4 correctly. 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.FileField of 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)