I ended up with this (from both of you, thanks):

urls.py:

(r'^contact/thanks/(?P<sender>.*)/$','mysite.books.views.thanks'),

and in my views.py:

def thanks(request, sender):
        return render_to_response('books/thanks.html',{'user': sender})

thanks.html:

{% extends 'base.html' %}

{% block title %} Thank You {% endblock %}

{% block content %}

<p> Thanks {{user}}.</p>

{% endblock %}

and it works.

But what I don't understand is the comment on GET.  I thought that was
what I was doing.  Or am I doing the same thing only wrong?  Are you
saying that I should use a querystring in the url like myurl/?
email=theemail&anothervar=something... instead of just the straight
URL technique.  That'll be different with regular web pages won't it
(pretty urls?)

Also, is the ?P a regular expression and is <> a python way of
embedding variables?

Sorry for so many questions.  I'm learning Python and Django at the
same time, well trying to.  Thank you.

On Apr 21, 8:26 pm, Alex Morega <[EMAIL PROTECTED]> wrote:
> On Apr 22, 2008, at 01:30 , jmDesktop wrote:
>
>
>
> > What I have in my urls.py file is:
>
> > (r'^contact/thanks/(.)/$','mysite.books.views.thanks'),
>
> try this:
>
> (r'^contact/thanks/(?P<sender>.*)/$','mysite.books.views.thanks'),
>
> The idea is to capture the sender part of the URL and pass it on as  
> the "sender" parameter to the view - I think this is what you want to  
> achieve. Also, remember that "." matches a single character; ".*" is  
> probably what you want (seehttp://docs.python.org/lib/re-syntax.html).
>
> Anyway, I don't think you want to be embedding e-mail addresses in  
> URLs directly. Better to use a GET parameter for that.
>
> Cheers,
> -- Alex
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to