Reputation: 4490
I added a link in myproject/templates/items/index.html like this
<a href="www.google.com">Search More</a>
My hope was that when a user clicks it, she would visit google.com. However, the result right now is this link is "myhost/items/www.google.com" instead of "www.google.com".
(I am modifying an existing app, and I have to admit I have not fully read django doc yet)
Upvotes: 3
Views: 7205
Reputation: 1861
Whenever you pass an external link to the <a href=''>
tag, always use http
.
So it will be like:
<a href="http://www.google.com">Search More</a>
Upvotes: 15
Reputation: 5256
You forgot the protocol:
<a href="http://www.google.com">Search More</a>
Upvotes: 5