Created
July 24, 2017 13:27
-
-
Save allieus/e5bfdf636e747ff9a793937a9175db0d to your computer and use it in GitHub Desktop.
CBV 에서 추가 context data 예시
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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