external urls

481 views
Skip to first unread message

hack

unread,
Mar 11, 2012, 2:27:33 PM3/11/12
to django...@googlegroups.com
How can I use an external URL in a django template?  For example, I have a CharField in the database/model and I want to display it on a template page as an external link.  However, when I do something like the following and click the link:
<a href="{{items.website|urlencode}}">{{items.website}}</a>  

django attempts to access the link as follows:

instead of:

Thanks.

Daniel Roseman

unread,
Mar 11, 2012, 2:53:12 PM3/11/12
to django...@googlegroups.com
This has nothing whatsoever to do with Django or templates. If you put a link into an HTML page just as <a href="www.google.com">, rather than <a href="http://www.google.com">, exactly the same thing will happen. The answer is not to do that.
--
DR. 

hack

unread,
Mar 11, 2012, 3:04:49 PM3/11/12
to django...@googlegroups.com
OH shoot, DUH, my bad.  Thanks for catching that man.  I've been staring at code for way too long.  LOL
Reply all
Reply to author
Forward
0 new messages