Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 11 lines (10 sloc) 0.523 kb
34260d2c »
2009-01-03 Added first reusable app
1 from django.contrib.comments.views.comments import post_comment
2
e26700fd »
2009-01-04 Ability to specify the next page after a comment is posted
3 def validate_and_submit(request, next=None):
34260d2c »
2009-01-03 Added first reusable app
4 # The next three lines are slightly hackish but there's not
5 # much that can be done if we have to pass the ip
6 # address to recaptcha
4d0b52a0 »
2010-04-26 Take into consideration when the app is not behind a reverse proxy
7 ip_address = request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR', None))
34260d2c »
2009-01-03 Added first reusable app
8 post_querydict = request.POST.copy()
9 post_querydict.update({'remoteip': ip_address})
10 request.POST = post_querydict
e26700fd »
2009-01-04 Ability to specify the next page after a comment is posted
11 return post_comment(request, next=next)
Something went wrong with that request. Please try again.