@require_POST
@login_required
def preview_async(request):
 statsd.incr('forums.preview')
 m = OutboxMessage(sender=request.user, message=request.POST.get('content', ''))
 return render(request, 'messages/includes/message_preview.html', {'message': m})

@ require_POST @ login_required def preview_async ( request ) : statsd . incr ( 'forums.preview' ) m = OutboxMessage ( sender = request . user , message = request . POST . get ( 'content' , '' ) ) return render ( request , 'messages/includes/message_preview.html' , { 'message' : m } )
ajax preview of posts .