Guest User

Untitled

a guest
Jan 1st, 2013
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. def index(request):
  2.     latest_posts_list = Post.objects.all().order_by('-pub_date')[:5]
  3.     req = request.method   # is shown easily in {{ req }} because it's a string
  4.     # request.body is a byte string and i see nothing if using {{ req }}
  5.     req = request.body.decode('utf-8') # doesn't help
  6.     req = unicode(request.body) # doesn't help
  7.     return render_to_response(
  8.     'posts/index.html',
  9.         {'latest_posts_list' : latest_posts_list,
  10.           'req' : req
  11.         }
  12.     )
Advertisement
Add Comment
Please, Sign In to add comment