On Wed, Jan 28, 2009 at 4:28 PM, May <adles...@gmail.com> wrote:

>
> Hello,
>
> I am extracting data from a postgres table into an html table.  I have
> two columns.
>
> The user can select the link in this column, the link will be returned
> through the URL and view.py to extract more information from the
> postgres table:
> <td ><a href="{{researchproject.id}}"> {{ researchproject.restitle|
> safe }}</a></td>
>
> This column will have the http:// address for an institution, which I
> would like the user to be able to directly link to an external
> website.  My error is that django won't allow me to directly link to
> an external website without first assigning a URL and a view.  How can
> I override django on this?
>
> <td ><a href="researchproject.website">{{ researchproject.institution|
> safe }}</td>
>
> Thanks for any help.
>

What do you mean "django won't allow me to directly link to an external
website"?  Django doesn't care what links you include on your pages.  In the
example you give you are specifying "researchproject.website" as an href.
That's a relative link, so when you click on it the browser will request the
linked page from the same server where it got the page containing the link.
If you want to link to an entirely different site, you need to specify your
href value to reflect that, something more like:

<a href="http://researchproject.website";>{{ researchproject.institution
}}</a>

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to