문제

I am new to Django. I want to ask a basic question.

I have an anchor tag in the template

<a href="www.abc.com">website</a>

when I get the rendered template in the webpage, I get an url like this:

www.mydomain.com/my_current_page/www.abc.com

and actually it goes to the same url, while in html I can only find the href to be equal to:

www.abc.com

I also added target=_blank to open in the new page. Is this fine the way I am doing this?

도움이 되었습니까?

해결책

You'll need to declare the anchor like this:

<a href="http://www.abc.com">website</a>

Otherwise the browser will interpret it like a relative url and will happen what you just explained.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top