def raw_post_view(request):
 if (request.method == 'POST'):
  root = parseString(request.body)
  first_book = root.firstChild.firstChild
  (title, author) = [n.firstChild.nodeValue for n in first_book.childNodes]
  t = Template('{{ title }} - {{ author }}', name='Book template')
  c = Context({'title': title, 'author': author})
 else:
  t = Template('GET request.', name='Book GET template')
  c = Context()
 return HttpResponse(t.render(c))

def raw_post_view ( request ) : if ( request . method == 'POST' ) : root = parseString ( request . body ) first_book = root . firstChild . firstChild ( title , author ) = [ n . firstChild . nodeValue for n in first_book . childNodes ] t = Template ( '{{ title }} - {{ author }}' , name = 'Book template' ) c = Context ( { 'title' : title , 'author' : author } ) else : t = Template ( 'GET request.' , name = 'Book GET template' ) c = Context ( ) return HttpResponse ( t . render ( c ) )
a view which expects raw xml to be posted and returns content extracted from the xml .