media django

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)

Here is what the above code is Doing:
1. We’re appending static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) to our URLconf.
2. Whenever Django encounters include(‘myapp.urls’) in urls.py, it cuts off whatever part of the URL matched up to that point and sends the remaining string to myapp.urls.urlpatterns for further processing.
3. static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) is effectively a catch-all URL pattern for files in your MEDIA_ROOT folder.
4. Whenever Django finds a URL that doesn’t match any of the patterns in urls.py, it calls the handler404 view.
5. We’re using the staticfiles_urlpatterns() helper function to return the URL patterns we’ve defined in urls.py, plus any other URL patterns that Django has defined.
6. We’re appending static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) to the list of URL patterns returned by staticfiles_urlpatterns().
7. We’re using the static() helper function to add a pattern that points to MEDIA_ROOT.
8. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
9. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
10. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
11. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
12. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
13. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
14. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
15. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
16. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
17. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
18. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
19. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
20. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
21. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
22. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
23. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
24. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
25. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
26. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
27. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
28. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
29. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
30. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
31. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
32. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
33. We’re using the staticfiles_storage.url() method on our static files to tell Django to use the relative URL.
34. We’re using the staticfiles_storage