landing페이지 수정, 카테고리 리스트 정리
All checks were successful
Build And Test / build-and-push (push) Successful in 5m13s
All checks were successful
Build And Test / build-and-push (push) Successful in 5m13s
This commit is contained in:
@ -1,18 +1,23 @@
|
||||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.views.generic import TemplateView
|
||||
from pathlib import Path
|
||||
import markdown
|
||||
import os
|
||||
from .models import NoticeBoard, IPManagementRecord
|
||||
from blog.models import Post
|
||||
from .forms import PostForm
|
||||
from django.db.models import Q
|
||||
|
||||
|
||||
def hello_view(request):
|
||||
return render(
|
||||
request,
|
||||
"butler/landing.html",
|
||||
)
|
||||
class LandingPageView(TemplateView):
|
||||
template_name = "butler/landing.html"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['blog_posts'] = Post.objects.order_by('-created_at')[:3]
|
||||
context['notices'] = NoticeBoard.objects.order_by('-created_at')[:3]
|
||||
return context
|
||||
|
||||
# --- notice ---
|
||||
@login_required
|
||||
|
Reference in New Issue
Block a user