Re: CSRF Flatpages

2009-11-29 Thread rebus_
2009/11/28 John Leith :
> I have a problem with the CSRF framework, and i'm just checking here
> to see if anyone else ran into this problem and hopefully found a
> solution. Here is my problem:
>
> I have a login form on the base template of my site. The home page is
> just a flatpage. My login processor is csrf protected. I have the
> middleware and the {% csrf_token %} is set in the template.
>
> The problem is that there is no output from the template tag, it
> dosen't contribute anything at all to the rendered HTML. So naturally,
> I can't login from the homepage.
>
> I poked around in the code, and i planning on digging some more.
> However, if someone else has encountered this, i sure would appreciate
> some guidance.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@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.
>
>
>

Flat pages are used to store plain HTML [1], you can't use filter nor
templatetags in them (perhaps you could with some weird middleware or
something but it would not be good solution).

Create custom HTML template for you login view, pass the template name
to your login url pattern (if you don't need custom view) and
everything should work out fine i think.

 url(r'^login/$', 'login',
{'template_name': 'registration/login.html'},
name='login'),

[1] 
http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/#module-django.contrib.flatpages

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.




CSRF Flatpages

2009-11-28 Thread John Leith
I have a problem with the CSRF framework, and i'm just checking here
to see if anyone else ran into this problem and hopefully found a
solution. Here is my problem:

I have a login form on the base template of my site. The home page is
just a flatpage. My login processor is csrf protected. I have the
middleware and the {% csrf_token %} is set in the template.

The problem is that there is no output from the template tag, it
dosen't contribute anything at all to the rendered HTML. So naturally,
I can't login from the homepage.

I poked around in the code, and i planning on digging some more.
However, if someone else has encountered this, i sure would appreciate
some guidance.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.