title: Flask Python - Adding links to other websites from a list of URLs
body: <p>I am trying to create a web app and store links to other sites in my MongoDB database using flask. I can now store the links, also display them but instead of directing me to that site keeps me flask app. This is what I've done</p>
  
  <pre><code>{% extends "base.html" %}
  {% block title %}Home{% endblock %}
  {% block content %}
  &lt;center&gt;
      &lt;form action="#" method="post"&gt;
          &lt;input type="text" name="url" placeholder="Enter URL"&gt;
          &lt;input type="text" name="name" placeholder="Enter name"&gt;
          &lt;input type="submit" value="Submit" class="btn btn-danger"&gt;
      &lt;/form&gt;
      {% for item in data %}
      &lt;div class="card" style="width: 18rem;"&gt;
          &lt;h3 class="card-title"&gt;{{ item['name'] }}&lt;/h3&gt;
          &lt;a href="{{ item['link'] }}" class="btn btn-danger"&gt;Link&lt;/a&gt;
      &lt;/div&gt;
      {% endfor %}
  &lt;/center&gt;
  {% endblock %}
  </code></pre>
  
  <p>Let's say I want to go to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a>, it takes me to <a href="http://127.0.0.1:5000/https://example.com" rel="nofollow noreferrer">http://127.0.0.1:5000/https://example.com</a> instead. I can provide more code if needed, just thought this should be enough.</p>