api.py 318 Bytes
Newer Older
Sli's avatar
Sli committed
1
2
3
4
5
6
7
8
9
10
11
12
13
from rest_framework.response import Response
from rest_framework.decorators import api_view

from core.templatetags.renderer import markdown


@api_view(['GET'])
def RenderMarkdown(request):
    """
        Render Markdown
    """
    if request.method == 'GET':
        return Response(markdown(request.GET['text']))