django-markitup-sillyfork/markitup/views.py

19 lines
553 B
Python
Raw Permalink Normal View History

2009-03-09 17:47:21 +00:00
"""
views for django-markitup
Time-stamp: <2009-03-18 11:24:32 carljm views.py>
2009-03-09 17:47:21 +00:00
"""
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from markitup.markup import filter_func
2011-11-08 03:40:14 +00:00
from django.views.decorators.csrf import csrf_exempt
2011-11-08 03:40:14 +00:00
@csrf_exempt
def apply_filter(request):
markup = filter_func(request.POST.get('data', ''))
2009-03-09 17:47:21 +00:00
return render_to_response( 'markitup/preview.html',
{'preview':markup},
context_instance=RequestContext(request))