title: Placing markers on Google Map With Django
body: <p>I'm trying to place markers based on the latitude and longitude stored in a model on a Google Map using the API and HTML5 geolocation.</p>
  
  <p>The issue is how to loop through the lat/lon info for each object stored within JavaScript tags using template keywords, which I don't believe can be done in Django.</p>
  
  <p>I found a similar question here <a href="https://stackoverflow.com/questions/8857795/adding-google-map-markers-with-django-template-tags-in-javascript">Adding Google Map Markers with DJango Template Tags in Javascript</a> which I mildly modified and placed within a template – not a separate script file – but it doesn't seem to work:</p>
  
  <pre><code>function loadMarkers(){
          {% for story in stories %}
              var point = new google.maps.LatLng({{story.latitude}},{{story.longitude}});
              var marker = new google.maps.Marker({
              position: point,
              map: map
          });
          {% endfor %}    
      }
  </code></pre>
  
  <p>Any insight on how to properly loop through items in a stored Django object with lat, lon info and place these on a Google Map using the API would be very appreciated.</p>