Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://127.0.0.1:8000/var/cea4067b96/
- class MyView(TemplateView):
- template_name = 'index.html'
- def get_context_data(self, **kwargs):
- context = super(MyView, self).get_context_data(**kwargs)
- context['data'] = 2
- return context
- >>> def f(**kwargs):
- ... if 'i' in kwargs: print(kwargs['i'])
- ...
- >>> f(i=1)
- 1
- >>> def f(**kwargs):
- ... print({i: kwargs[i] for i in kwargs})
- ...
- >>> f(i=1, r=2)
- {'r': 2, 'i': 1}
Add Comment
Please, Sign In to add comment