'what is the use of creating a new way of url pattern in this code and what does it symbolize?
Blockquote file path of the url hello guys i am just a beginner in django so i cant understad what is the use of using this url pattern in this code from django.conf import settings from django.conf.urls.static import static
urlpatterns += static(settings.MEIDIA_URL, document_root=settings.MEDIA_ROOT)
djangodjango-modelsdjango-viewsdjango-formsdjango-templatesjavaspring-webfluxspring-webclientjsonnode
Solution 1:[1]
since user-uploaded content is assumed to exist in a production context, to see media items locally we need to update config/urls.py to show the files locally. This involves importing both settings and static at the top and then adding an additional line at the bottom.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vijay Soni |
