title: Link to an outside site using a URLField from a model in Django
body: <p>Is there a way to link to an outside site using a URLField from a model in the template?  I have the href link set up as a template variable, but the link is throwing a 404 error.</p>
  
  <p>Here is my model.py:</p>
  
  <pre><code>class Blog(models.Model):
    # other fields
    link = models.URLField(blank=True)
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>def get_context_data(self, **kwargs):
      context = super(IndexView, self).get_context_data(**kwargs)
      context['blogs'] = Blog.objects.all()[:3]
      return context
  </code></pre>
  
  <p>my template.html:</p>
  
  <pre><code>   &lt;ul class="thumbnails"&gt;
        {% if blogs %}
          {% for blog in blogs %}
          &lt;li class="span3"&gt; &lt;a class="prdocutname mb10" href="#"&gt;{{ blog.title }}&lt;/a&gt;
            &lt;div class="thumbnail"&gt; &lt;a href="#"&gt;&lt;img alt="{{ blog.title }}" src="{{ STATIC_URL }}{{ blog.picture }}" height="222" width="300"&gt;&lt;/a&gt;
              &lt;div class="price"&gt;
                  &lt;ul&gt;&lt;li&gt;{{ blog.story_description }}&lt;/li&gt;&lt;/ul&gt;
              &lt;/div&gt;
              &lt;a href="{( blog.link )}"&gt;Go to Story&lt;/a&gt;
            &lt;/div&gt;
          &lt;/li&gt;
          {% endfor %}
        {% endif %}
    &lt;/ul&gt;
  </code></pre>
  
  <p>Everytime though when I click the link, it sends me to this URL:</p>
  
  <pre><code>http://localhost:8000/%7B(%20blog.link%20)%7D
  </code></pre>
  
  <p>and I get a 404 Error.
  It looks like it is adding it onto local host instead of generating the absolute URL that is saved in the model.  Is there a way to fix this?</p>
  
  <p>I am on Django 1.5, Python 2.7</p>
  
  <p>Kind regards,
  Aaron</p>