I have a jinja2 template that contains hrefs
<td><a href="{{entry.Url}}">Product URL</a></td>
However, when I run the application and click the link on the page I get the development server in front of the correct url. So it would look like the following in the browser:
http://121.1.2.1:8764/www.google.com/
When I just want the following link:
www.google.com
Any ideas on how I can get this to work?
Thanks!
Without adding a prefix, the root of the URL will be your local environment. In this case it's your IP address.
To correct the issue, add a HTTPS
prefix like so:
<a href="https://{{ entry.Url }}">{{ entry.Url }}</a>
This worked for me while testing.
<a href="{{ ''.join(['http://', entry.Url]) }}">{{ entry.Url }}</a>
# entry.Url == www.google.com
# <a href="http://www.google.com">www.google.com</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With