Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a hyperlink to external website in django

I have a little problem about creating a hyperlink to an external website in django, for example in to the google.com I have in my html file something like :

Adres www: <a href="{{ det_wpisu.adres_www }}">{{ det_wpisu.adres_www }}</a> <br />

but the www address when I click showing me :

http://localhost:8000/detale/3/www.google.com

and returned the 404 page.

like image 655
killerbees Avatar asked Oct 21 '25 14:10

killerbees


1 Answers

Ensure the variable det_wpisu.adres_www contains a full URL including https://, eg:

context = {'det_wpisu.adres_www': 'https://www.google.com'}
like image 71
nemesisdesign Avatar answered Oct 24 '25 21:10

nemesisdesign



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!