Skip to content

Instantly share code, notes, and snippets.

@pylemon
pylemon / get_current_url.py
Created April 5, 2012 06:45
django: get current url within template
## views.py
from django.shortcuts import render_to_response
from django.template.context import RequestContext
def home(request):
return render_to_response('home.html', {},
context_instance=RequestContext(request))
## don't forget RequestContext, that makes request var can be used in templates