how to show external media in template in django












0














Hi i'm currently new to Django and i'm trying to populate a product page.



I'm having problem with the img to show the image(which uses an image url online instead of a file) for example an img src="media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg"



The url already in my database with the text media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg



But when i tried to render it in template the image doesn't show
I tried to used the but it still not work
Any help would be appreciate!



My template



 {% for discount in discounts|slice:":8" %}
<div class="col-md-3 product-men women_two">
<div class="product-googles-info googles">
<div class="men-pro-item">
<div class="men-thumb-item">
<img src="{{STATIC_URL}}{{discount.product_image}}" alt=""/>
<div class="men-cart-pro">
<div class="inner-men-cart-pro">
<a href="single .html" class="link-product-add-cart">Quick View</a>
</div>
</div>
<span class="product-new-top">New</span>
</div>
<div class="item-info-product">
<div class="info-product-price">
<div class="grid_meta">
<div class="product_price">
<h4>
<a href="single.html">{{discount.product_name}}</a>
</h4>
<div class="grid-price mt-2">
<span class="money ">{{discount.product_old_price}}</span>
</div>
</div>
<div>
<h3>{{discount.product_sit}}</h3>
</div>
<div><h2 style="color:red">Only {{discount.product_price}}!</h2></div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
{% endfor %}


EDIT



Seems like the image src trying to get is "http://127.0.0.1:8000/media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg" which i don't want "http://127.0.0.1:8000/" in the link. Is there a way to remove this when using {{discount.product_image}} tag ?



Main project urls.py:



from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('frontend.urls')),
]


frontend app urls.py:



from  django.urls import path
from .import views
from django.conf import settings
from django.conf.urls.static import static
app_name = 'frontend'
urlpatterns = [
#index
path('',views.index, name='index')
]









share|improve this question





























    0














    Hi i'm currently new to Django and i'm trying to populate a product page.



    I'm having problem with the img to show the image(which uses an image url online instead of a file) for example an img src="media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg"



    The url already in my database with the text media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg



    But when i tried to render it in template the image doesn't show
    I tried to used the but it still not work
    Any help would be appreciate!



    My template



     {% for discount in discounts|slice:":8" %}
    <div class="col-md-3 product-men women_two">
    <div class="product-googles-info googles">
    <div class="men-pro-item">
    <div class="men-thumb-item">
    <img src="{{STATIC_URL}}{{discount.product_image}}" alt=""/>
    <div class="men-cart-pro">
    <div class="inner-men-cart-pro">
    <a href="single .html" class="link-product-add-cart">Quick View</a>
    </div>
    </div>
    <span class="product-new-top">New</span>
    </div>
    <div class="item-info-product">
    <div class="info-product-price">
    <div class="grid_meta">
    <div class="product_price">
    <h4>
    <a href="single.html">{{discount.product_name}}</a>
    </h4>
    <div class="grid-price mt-2">
    <span class="money ">{{discount.product_old_price}}</span>
    </div>
    </div>
    <div>
    <h3>{{discount.product_sit}}</h3>
    </div>
    <div><h2 style="color:red">Only {{discount.product_price}}!</h2></div>
    </div>
    </div>
    <div class="clearfix"></div>
    </div>
    </div>
    </div>
    </div>
    {% endfor %}


    EDIT



    Seems like the image src trying to get is "http://127.0.0.1:8000/media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg" which i don't want "http://127.0.0.1:8000/" in the link. Is there a way to remove this when using {{discount.product_image}} tag ?



    Main project urls.py:



    from django.contrib import admin
    from django.urls import path, include

    urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('frontend.urls')),
    ]


    frontend app urls.py:



    from  django.urls import path
    from .import views
    from django.conf import settings
    from django.conf.urls.static import static
    app_name = 'frontend'
    urlpatterns = [
    #index
    path('',views.index, name='index')
    ]









    share|improve this question



























      0












      0








      0







      Hi i'm currently new to Django and i'm trying to populate a product page.



      I'm having problem with the img to show the image(which uses an image url online instead of a file) for example an img src="media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg"



      The url already in my database with the text media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg



      But when i tried to render it in template the image doesn't show
      I tried to used the but it still not work
      Any help would be appreciate!



      My template



       {% for discount in discounts|slice:":8" %}
      <div class="col-md-3 product-men women_two">
      <div class="product-googles-info googles">
      <div class="men-pro-item">
      <div class="men-thumb-item">
      <img src="{{STATIC_URL}}{{discount.product_image}}" alt=""/>
      <div class="men-cart-pro">
      <div class="inner-men-cart-pro">
      <a href="single .html" class="link-product-add-cart">Quick View</a>
      </div>
      </div>
      <span class="product-new-top">New</span>
      </div>
      <div class="item-info-product">
      <div class="info-product-price">
      <div class="grid_meta">
      <div class="product_price">
      <h4>
      <a href="single.html">{{discount.product_name}}</a>
      </h4>
      <div class="grid-price mt-2">
      <span class="money ">{{discount.product_old_price}}</span>
      </div>
      </div>
      <div>
      <h3>{{discount.product_sit}}</h3>
      </div>
      <div><h2 style="color:red">Only {{discount.product_price}}!</h2></div>
      </div>
      </div>
      <div class="clearfix"></div>
      </div>
      </div>
      </div>
      </div>
      {% endfor %}


      EDIT



      Seems like the image src trying to get is "http://127.0.0.1:8000/media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg" which i don't want "http://127.0.0.1:8000/" in the link. Is there a way to remove this when using {{discount.product_image}} tag ?



      Main project urls.py:



      from django.contrib import admin
      from django.urls import path, include

      urlpatterns = [
      path('admin/', admin.site.urls),
      path('', include('frontend.urls')),
      ]


      frontend app urls.py:



      from  django.urls import path
      from .import views
      from django.conf import settings
      from django.conf.urls.static import static
      app_name = 'frontend'
      urlpatterns = [
      #index
      path('',views.index, name='index')
      ]









      share|improve this question















      Hi i'm currently new to Django and i'm trying to populate a product page.



      I'm having problem with the img to show the image(which uses an image url online instead of a file) for example an img src="media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg"



      The url already in my database with the text media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg



      But when i tried to render it in template the image doesn't show
      I tried to used the but it still not work
      Any help would be appreciate!



      My template



       {% for discount in discounts|slice:":8" %}
      <div class="col-md-3 product-men women_two">
      <div class="product-googles-info googles">
      <div class="men-pro-item">
      <div class="men-thumb-item">
      <img src="{{STATIC_URL}}{{discount.product_image}}" alt=""/>
      <div class="men-cart-pro">
      <div class="inner-men-cart-pro">
      <a href="single .html" class="link-product-add-cart">Quick View</a>
      </div>
      </div>
      <span class="product-new-top">New</span>
      </div>
      <div class="item-info-product">
      <div class="info-product-price">
      <div class="grid_meta">
      <div class="product_price">
      <h4>
      <a href="single.html">{{discount.product_name}}</a>
      </h4>
      <div class="grid-price mt-2">
      <span class="money ">{{discount.product_old_price}}</span>
      </div>
      </div>
      <div>
      <h3>{{discount.product_sit}}</h3>
      </div>
      <div><h2 style="color:red">Only {{discount.product_price}}!</h2></div>
      </div>
      </div>
      <div class="clearfix"></div>
      </div>
      </div>
      </div>
      </div>
      {% endfor %}


      EDIT



      Seems like the image src trying to get is "http://127.0.0.1:8000/media3.scdn.vn/img2/2018/6_2/ZIBLXA_simg_b5529c_250x250_maxb.jpg" which i don't want "http://127.0.0.1:8000/" in the link. Is there a way to remove this when using {{discount.product_image}} tag ?



      Main project urls.py:



      from django.contrib import admin
      from django.urls import path, include

      urlpatterns = [
      path('admin/', admin.site.urls),
      path('', include('frontend.urls')),
      ]


      frontend app urls.py:



      from  django.urls import path
      from .import views
      from django.conf import settings
      from django.conf.urls.static import static
      app_name = 'frontend'
      urlpatterns = [
      #index
      path('',views.index, name='index')
      ]






      html django image






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 6:48









      MD. Khairul Basar

      2,782101938




      2,782101938










      asked Nov 13 '18 at 4:51









      Zerontelli

      849




      849
























          1 Answer
          1






          active

          oldest

          votes


















          2














          Try using .url like this.



          <img src="{{ discount.product_image.url }}"  alt=""/>


          Also add the MEDIA and STATIC url to your project url patterns.



          from django.conf import settings
          from django.conf.urls.static import static

          urlpatterns = [
          # ... the rest of your URL pattern goes here ...
          ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
          + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


          EDIT:



          From the discussion in chat, I understood that I had misunderstood your problem first. The images are external and not in your db, you are just storing the URL to the images. And you are using a TextField not ImageField. I assumed ImageField previously. So, all you have to do is to replace {{STATIC_URL}} from in front of the actual URL and put http:// there. The reason behind this is, as the src is missing http:// it's assumed the image to be in the same host domain. So it goes to http://127.0.0.1/your_url.



          <img src="http://{{ discount.product_image }}"  alt=""/>





          share|improve this answer























          • it still doesn't work . It came back with "[13/Nov/2018 13:53:49] "GET /media3.scdn.vn/img2/2018/6_8/3eJ0YO_simg_b5529c_250x250_maxb.jpg HTTP/1.1" 404 2290" it seem to created a "/" before the url which make the link the the url wrong
            – Zerontelli
            Nov 13 '18 at 4:59












          • I've already updated my answer. try adding that.
            – MD. Khairul Basar
            Nov 13 '18 at 5:00










          • Also, make sure you have set MEDIA_URL, MEDIA_ROOT STATIC_URL, STATIC_ROOT correctly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:02












          • now the other url for the website(main page) won't work File "C:UsersadminMiniconda3libsite-packagesdjango-2.1-py3.6.eggdjangoconfurlsstatic.py", line 21, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
            – Zerontelli
            Nov 13 '18 at 5:25










          • You haven't set STATIC_URL and STATIC_ROOT properly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:29











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274022%2fhow-to-show-external-media-in-template-in-django%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Try using .url like this.



          <img src="{{ discount.product_image.url }}"  alt=""/>


          Also add the MEDIA and STATIC url to your project url patterns.



          from django.conf import settings
          from django.conf.urls.static import static

          urlpatterns = [
          # ... the rest of your URL pattern goes here ...
          ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
          + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


          EDIT:



          From the discussion in chat, I understood that I had misunderstood your problem first. The images are external and not in your db, you are just storing the URL to the images. And you are using a TextField not ImageField. I assumed ImageField previously. So, all you have to do is to replace {{STATIC_URL}} from in front of the actual URL and put http:// there. The reason behind this is, as the src is missing http:// it's assumed the image to be in the same host domain. So it goes to http://127.0.0.1/your_url.



          <img src="http://{{ discount.product_image }}"  alt=""/>





          share|improve this answer























          • it still doesn't work . It came back with "[13/Nov/2018 13:53:49] "GET /media3.scdn.vn/img2/2018/6_8/3eJ0YO_simg_b5529c_250x250_maxb.jpg HTTP/1.1" 404 2290" it seem to created a "/" before the url which make the link the the url wrong
            – Zerontelli
            Nov 13 '18 at 4:59












          • I've already updated my answer. try adding that.
            – MD. Khairul Basar
            Nov 13 '18 at 5:00










          • Also, make sure you have set MEDIA_URL, MEDIA_ROOT STATIC_URL, STATIC_ROOT correctly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:02












          • now the other url for the website(main page) won't work File "C:UsersadminMiniconda3libsite-packagesdjango-2.1-py3.6.eggdjangoconfurlsstatic.py", line 21, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
            – Zerontelli
            Nov 13 '18 at 5:25










          • You haven't set STATIC_URL and STATIC_ROOT properly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:29
















          2














          Try using .url like this.



          <img src="{{ discount.product_image.url }}"  alt=""/>


          Also add the MEDIA and STATIC url to your project url patterns.



          from django.conf import settings
          from django.conf.urls.static import static

          urlpatterns = [
          # ... the rest of your URL pattern goes here ...
          ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
          + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


          EDIT:



          From the discussion in chat, I understood that I had misunderstood your problem first. The images are external and not in your db, you are just storing the URL to the images. And you are using a TextField not ImageField. I assumed ImageField previously. So, all you have to do is to replace {{STATIC_URL}} from in front of the actual URL and put http:// there. The reason behind this is, as the src is missing http:// it's assumed the image to be in the same host domain. So it goes to http://127.0.0.1/your_url.



          <img src="http://{{ discount.product_image }}"  alt=""/>





          share|improve this answer























          • it still doesn't work . It came back with "[13/Nov/2018 13:53:49] "GET /media3.scdn.vn/img2/2018/6_8/3eJ0YO_simg_b5529c_250x250_maxb.jpg HTTP/1.1" 404 2290" it seem to created a "/" before the url which make the link the the url wrong
            – Zerontelli
            Nov 13 '18 at 4:59












          • I've already updated my answer. try adding that.
            – MD. Khairul Basar
            Nov 13 '18 at 5:00










          • Also, make sure you have set MEDIA_URL, MEDIA_ROOT STATIC_URL, STATIC_ROOT correctly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:02












          • now the other url for the website(main page) won't work File "C:UsersadminMiniconda3libsite-packagesdjango-2.1-py3.6.eggdjangoconfurlsstatic.py", line 21, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
            – Zerontelli
            Nov 13 '18 at 5:25










          • You haven't set STATIC_URL and STATIC_ROOT properly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:29














          2












          2








          2






          Try using .url like this.



          <img src="{{ discount.product_image.url }}"  alt=""/>


          Also add the MEDIA and STATIC url to your project url patterns.



          from django.conf import settings
          from django.conf.urls.static import static

          urlpatterns = [
          # ... the rest of your URL pattern goes here ...
          ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
          + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


          EDIT:



          From the discussion in chat, I understood that I had misunderstood your problem first. The images are external and not in your db, you are just storing the URL to the images. And you are using a TextField not ImageField. I assumed ImageField previously. So, all you have to do is to replace {{STATIC_URL}} from in front of the actual URL and put http:// there. The reason behind this is, as the src is missing http:// it's assumed the image to be in the same host domain. So it goes to http://127.0.0.1/your_url.



          <img src="http://{{ discount.product_image }}"  alt=""/>





          share|improve this answer














          Try using .url like this.



          <img src="{{ discount.product_image.url }}"  alt=""/>


          Also add the MEDIA and STATIC url to your project url patterns.



          from django.conf import settings
          from django.conf.urls.static import static

          urlpatterns = [
          # ... the rest of your URL pattern goes here ...
          ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
          + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


          EDIT:



          From the discussion in chat, I understood that I had misunderstood your problem first. The images are external and not in your db, you are just storing the URL to the images. And you are using a TextField not ImageField. I assumed ImageField previously. So, all you have to do is to replace {{STATIC_URL}} from in front of the actual URL and put http:// there. The reason behind this is, as the src is missing http:// it's assumed the image to be in the same host domain. So it goes to http://127.0.0.1/your_url.



          <img src="http://{{ discount.product_image }}"  alt=""/>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 13 '18 at 7:03

























          answered Nov 13 '18 at 4:57









          MD. Khairul Basar

          2,782101938




          2,782101938












          • it still doesn't work . It came back with "[13/Nov/2018 13:53:49] "GET /media3.scdn.vn/img2/2018/6_8/3eJ0YO_simg_b5529c_250x250_maxb.jpg HTTP/1.1" 404 2290" it seem to created a "/" before the url which make the link the the url wrong
            – Zerontelli
            Nov 13 '18 at 4:59












          • I've already updated my answer. try adding that.
            – MD. Khairul Basar
            Nov 13 '18 at 5:00










          • Also, make sure you have set MEDIA_URL, MEDIA_ROOT STATIC_URL, STATIC_ROOT correctly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:02












          • now the other url for the website(main page) won't work File "C:UsersadminMiniconda3libsite-packagesdjango-2.1-py3.6.eggdjangoconfurlsstatic.py", line 21, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
            – Zerontelli
            Nov 13 '18 at 5:25










          • You haven't set STATIC_URL and STATIC_ROOT properly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:29


















          • it still doesn't work . It came back with "[13/Nov/2018 13:53:49] "GET /media3.scdn.vn/img2/2018/6_8/3eJ0YO_simg_b5529c_250x250_maxb.jpg HTTP/1.1" 404 2290" it seem to created a "/" before the url which make the link the the url wrong
            – Zerontelli
            Nov 13 '18 at 4:59












          • I've already updated my answer. try adding that.
            – MD. Khairul Basar
            Nov 13 '18 at 5:00










          • Also, make sure you have set MEDIA_URL, MEDIA_ROOT STATIC_URL, STATIC_ROOT correctly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:02












          • now the other url for the website(main page) won't work File "C:UsersadminMiniconda3libsite-packagesdjango-2.1-py3.6.eggdjangoconfurlsstatic.py", line 21, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
            – Zerontelli
            Nov 13 '18 at 5:25










          • You haven't set STATIC_URL and STATIC_ROOT properly.
            – MD. Khairul Basar
            Nov 13 '18 at 5:29
















          it still doesn't work . It came back with "[13/Nov/2018 13:53:49] "GET /media3.scdn.vn/img2/2018/6_8/3eJ0YO_simg_b5529c_250x250_maxb.jpg HTTP/1.1" 404 2290" it seem to created a "/" before the url which make the link the the url wrong
          – Zerontelli
          Nov 13 '18 at 4:59






          it still doesn't work . It came back with "[13/Nov/2018 13:53:49] "GET /media3.scdn.vn/img2/2018/6_8/3eJ0YO_simg_b5529c_250x250_maxb.jpg HTTP/1.1" 404 2290" it seem to created a "/" before the url which make the link the the url wrong
          – Zerontelli
          Nov 13 '18 at 4:59














          I've already updated my answer. try adding that.
          – MD. Khairul Basar
          Nov 13 '18 at 5:00




          I've already updated my answer. try adding that.
          – MD. Khairul Basar
          Nov 13 '18 at 5:00












          Also, make sure you have set MEDIA_URL, MEDIA_ROOT STATIC_URL, STATIC_ROOT correctly.
          – MD. Khairul Basar
          Nov 13 '18 at 5:02






          Also, make sure you have set MEDIA_URL, MEDIA_ROOT STATIC_URL, STATIC_ROOT correctly.
          – MD. Khairul Basar
          Nov 13 '18 at 5:02














          now the other url for the website(main page) won't work File "C:UsersadminMiniconda3libsite-packagesdjango-2.1-py3.6.eggdjangoconfurlsstatic.py", line 21, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
          – Zerontelli
          Nov 13 '18 at 5:25




          now the other url for the website(main page) won't work File "C:UsersadminMiniconda3libsite-packagesdjango-2.1-py3.6.eggdjangoconfurlsstatic.py", line 21, in static raise ImproperlyConfigured("Empty static prefix not permitted") django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted
          – Zerontelli
          Nov 13 '18 at 5:25












          You haven't set STATIC_URL and STATIC_ROOT properly.
          – MD. Khairul Basar
          Nov 13 '18 at 5:29




          You haven't set STATIC_URL and STATIC_ROOT properly.
          – MD. Khairul Basar
          Nov 13 '18 at 5:29


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274022%2fhow-to-show-external-media-in-template-in-django%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python