|
|
@@ -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) |