On 16:12 Mon 24 Jun     , Deepak Sharma wrote:
> On Mon, Jun 24, 2013 at 3:58 PM, Tom Evans <tevans...@googlemail.com> wrote:
> >
> > Looks like you've updated your {% url %} tags to quote the view name,
> > and in this case, you've quoted both the view name and the argument
> > that should be used. This leads django to not find the view name.
> >
> > Eg: {% url "email_validation_process" key %}
> >
> > and not: {% url "email_validation_process key" %}
> 
> 
>  Okay now that error removed but now i am facing new error
> 
>  TypeError at /accounts/register/complete/
>  __init__() takes exactly 1 argument (3 given)
> 
> In my urls under en.py file i have
> 
>    # Registration
>     url(r'^register/$', register, name='signup'),
> 
>     url(r'^register/validate/$', TemplateView,
>         {'template' : 'userprofile/account/validate.html'},
>         name='signup_validate'),
> 
>     url(r'^register/complete/$', TemplateView,
>         {'template': 'userprofile/account/registration_done.html'},
>         name='signup_complete'),
> 
> --
> Deepak Kumar Sharma
> Blog:
> http://deekysharma.wordpress.com

Hi,

TemplateView is a generic class based view and to get a view function
out of it you need to call its as_view method, the appropriate lines in
your urls.py should be:

     url(r'^register/validate/$',
        TemplateView.as_view(template_name='userprofile/account/validate.html'),
        name='signup_validate'),

also note that template_name is an argument of as_view method rather
than the view it self (which is returned by TemplateView.as_view()
call).   The as_view function can set TemplateView class attributes
(which is shared for all classed based views, since it is how the base
View class behaves).  Note also that only the TemplateView passes view
arguments (the way you declared them) to the template context.  You
can try to read View (and TemplateView) source code, it should clarify
what I have explained here.

Best regards,
Marcin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to