Skip to content

Commit

Permalink
Fix Buyer's Guide image rendering (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmoo authored and Pomax committed Aug 2, 2018
1 parent 253e21b commit c4af8f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
@@ -1,6 +1,6 @@
<h2>{{product.name}}</h2>

<img src="/media/{{product.image}}" width="500"/>
<img src="{{mediaUrl}}{{product.image}}" width="500"/>
<div>
{{product.company}}
</div>
Expand Down
3 changes: 2 additions & 1 deletion network-api/networkapi/buyersguide/views.py
@@ -1,6 +1,7 @@
from django.shortcuts import render
from networkapi.buyersguide.models import Product
from django.contrib.auth.decorators import login_required
from django.conf import settings


# Login required so we can continue to develop this and merge into master without the public seeing it.
Expand All @@ -14,4 +15,4 @@ def buyersguide_home(request):
@login_required
def product_view(request, productname):
product = Product.objects.get(name__iexact=productname)
return render(request, 'product_page.html', {'product': product})
return render(request, 'product_page.html', {'product': product, 'mediaUrl': settings.MEDIA_URL})

0 comments on commit c4af8f3

Please sign in to comment.