-
-
Save girasquid/2952168 to your computer and use it in GitHub Desktop.
Django View
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.shortcuts import render | |
def some_view(request, template_name='path/to/template.html', extra_context={}): | |
context = extra_context.copy() | |
# Request remote page and parse it | |
foo = 'Some template variable' | |
context['foo'] = foo | |
return render(request, template_name, context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment