Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get database image in dajngo

# below STATIC_URL in settings.py add following code
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR

# Now add followinr code in urls.py
urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)

# Now in html code add following code for src
<img class="card-img-top" src={{ name.image.url }}></img>
 
PREVIOUS NEXT
Tagged: #database #image #dajngo
ADD COMMENT
Topic
Name
5+8 =