chen
chen

Reputation: 4490

embed an external link in django app

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

Answers (2)

Amit Yadav
Amit Yadav

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

YardenST
YardenST

Reputation: 5256

You forgot the protocol:

<a href="http://www.google.com">Search More</a>

Upvotes: 5

Related Questions