Lennart Heimbs 5 years ago
parent
commit
fb4f003f39
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      news/posts/views.py

+ 4
- 0
news/posts/views.py View File

@@ -1,8 +1,10 @@
import logging

from django.shortcuts import render, redirect, render_to_response
from django.http import HttpResponse, JsonResponse
from django.utils import timezone
from django.contrib import messages
from django.views.decorators.csrf import csrf_exempt

from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
@@ -59,6 +61,7 @@ def delete(request, deleteId=None):
return redirect('posts')
@csrf_exempt
def notice_list(request):
if request.method == 'GET':
notices = Notice.objects.all()
@@ -74,6 +77,7 @@ def notice_list(request):
return JsonResponse(serializer.errors, status=400)


@csrf_exempt
def notice_detail(request, id):
try:
notice = Notice.objects.get(id=id)

Loading…
Cancel
Save