Skip to content

Instantly share code, notes, and snippets.

@allieus
Created July 24, 2017 13:27
Show Gist options
  • Save allieus/e5bfdf636e747ff9a793937a9175db0d to your computer and use it in GitHub Desktop.
Save allieus/e5bfdf636e747ff9a793937a9175db0d to your computer and use it in GitHub Desktop.
CBV 에서 추가 context data 예시
from django.views.generic import ListView
from .models import Post
class PostListView(ListView):
model = Post
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['추가인자'] = '지정할 값'
return context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment