With django you can define you url in urls.py as:
url(r'^sample$', sample, name='the_name'),
and then in your template use: {% url the_name %}
If it need a id or similar you can provide it with {% url the_name ID %}
On Mon, Aug 30, 2010 at 23:08, refreegrata <[email protected]> wrote:
> for the moment i don´t have a problem, the section of my site work's
> fine. Maybe is just a PHP habit.
>
> In php when a wont to build an url in the template i do somethin like
> ------------------------
> <?php $aaa = "óñ+" ?>
> echo '<a href="http://mysite.php?aaa='.urlencode($aaa).'>link</a>';
> --------------------------
> because $aaa can have some special characters.
>
> I thought that the urlencode filter do this in django. I must to build
> an url in the template with parameters for a filtered pagination.
>
> On 30 ago, 16:44, Alexandre González <[email protected]> wrote:
> > Why do you like to do it?
> >
> > I think that your problem is with codification, and not with
> urlenconde...
> > try to search about utf8 and html
> >
> >
> >
> > On Mon, Aug 30, 2010 at 22:09, refreegrata <[email protected]>
> wrote:
> > > i'm sorry in my last time accidentally send the post before of
> > > finish.
> > > I try to do in the template something like
> > > {{ my_var|urlencode }}
> > > but don't work. Can i do something like an urlencode in the template?
> >
> > > P.D.: I'm from Chile.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<django-users%[email protected]>
> <django-users%[email protected]<django-users%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
> >
> > --
> > Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx,
> .ppt
> > and/or .pptx
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.