I have a django application and in one of the templates I have something similar to:
<a href="/location/images/{{memb.EntryNr}}/">image</a>
This code is called multiple times - for each memb
there is an associated .svg
image that can be accessed with this url. Of course at the moment, there is just a link on the word 'image' to a separate page with the .svg
.
What I want is to have the .svg
's loaded into the template page instead of a link out. What is the easiest/best way to do this?
I am relatively new to Python/Django but I understand the basic concepts as well as HTML/CSS, however, I have zero experience with JavaScript.
EDIT: The .svg
's are not stored in the filesystem. There is a separate view (separate to the main one for the template I'm working on here) that goes a bit like this:
def svg_image(request, entry_nr):
svg_string = utils.DrawSVG.get_svg(entry_nr)
return HttpResponse(svg_string)
I then have the url, which is accessed in the HTML template code above:
url(r'^images/(?P<entry_nr>[0-9]+)/$', views.svg_image, name='svg_image')