urlpatterns = [
url(r'^api/v1/', include('webapp.urls')),
url(r'^admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls')),
]
from rest_framework import viewsets
from .models import Message
from .serializers import MessageSerializer
class MessageViewSet(viewsets.ModelViewSet):
queryset = Message.objects.all().order_by('-created_at')
serializer_class = MessageSerializer