First steps with the api

This commit is contained in:
2016-08-05 00:50:48 +02:00
parent ad36c1c6f6
commit feb7b4689b
15 changed files with 44 additions and 10 deletions

2
api/views/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from .api import *
from .serializers import *

13
api/views/api.py Normal file
View File

@ -0,0 +1,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']))

1
api/views/serializers.py Normal file
View File

@ -0,0 +1 @@
from rest_framework import serializers