Re: Using the CSRF token with two views

2012-09-04 Thread Robert Steckroth
Ya, that sounds like the way to go, thank you. The project is shaping up nicely, but you both were right about the JavaScript. I am thinking on a Django parsing view to do preliminary regex matching. Right now it is in the handled by the client with a 1-2 second delay/loading time. It looks incredi

Re: Using the CSRF token with two views

2012-09-04 Thread Bill Freeman
Of course, JavaScript will be involved. You can probably get the token from the cookies, but you could also add code to your (first) template to set a JS variable to the token. Then, when you (on the client side) get the form to display, you can insert the appropriate hidden element. Bill On Su

Re: Using the CSRF token with two views

2012-09-02 Thread Robert Steckroth
No actually the the template that renders the form is separate from the template that submits it. It is working with a @csrf_exempt on the processing view however. I guess I need a way to inform form processing view of the token it was given in the form serving view. I should be able to provide thi

Re: Using the CSRF token with two views

2012-09-01 Thread Melvyn Sopacua
On 2-9-2012 0:52, Robert Steckroth wrote: > The > problem is that the contact form > is provided by one view and processed by another. This, of course > raises a CSRF token error in the posting > submit. I don't see the logic of this, unless by view you mean request. This is also a bit confusing:

Using the CSRF token with two views

2012-09-01 Thread Robert Steckroth
Hello gang, I have created a dynamic template loading system utilizing ajax inside the template. The templates and data are retrieved and displayed as expected. The problem is that the contact form is provided by one view and processed by another. This, of course raises a CSRF token error in the po