Skip to content

Instantly share code, notes, and snippets.

@girasquid
Forked from TimFletcher/gist:2948882
Created June 19, 2012 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save girasquid/2952168 to your computer and use it in GitHub Desktop.
Save girasquid/2952168 to your computer and use it in GitHub Desktop.
Django View
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