If your file is completely static (even coming from a cache server) then there's no way of getting the csrf, since the whole point of the csrf is that it's dynamic (otherwise it can be copied).
You can do a one time "warmup" if the cookie is not present on your client to "get_data" from the server and initialize the cookie, or go without csrf as suggested.. On Mar 22, 12:35 am, Brian Craft <bc...@thecraftstudio.com> wrote: > No, it's not. It's a static file. > > On Mon, Mar 21, 2011 at 10:23 AM, Matt Robenolt > > > > > > > > <youdontevenk...@gmail.com> wrote: > > Is your main view being rendered by Django or something else? If so, you'll > > have access to the cookie. > > > On Mar 21, 2011, at 1:09 PM, Brian Craft wrote: > > >> It's in a cookie once you coerce django into sending the cookie to the > >> browser. This is less automatic for ajax apps, because django isn't > >> serving the forms (which is when it usually sends the csrf cookie). > > >> On Mon, Mar 21, 2011 at 9:49 AM, Matt Robenolt > >> <youdontevenk...@gmail.com> wrote: > >>> To get the token? It's stored in a cookie. You can read that in Javascript > >>> with document.cookie, then parse the cookie string to retrieve the > >>> relevant > >>> part. > > >>> -- > >>> 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 > >>> django-users+unsubscr...@googlegroups.com. > >>> For more options, visit this group at > >>>http://groups.google.com/group/django-users?hl=en. > > >> -- > >> 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 > >> django-users+unsubscr...@googlegroups.com. > >> For more options, visit this group > >> athttp://groups.google.com/group/django-users?hl=en. > > > -- > > 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 > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-users?hl=en. -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.