I\'m aware that you can get session variables using request.session[\'variable_name\'], but there doesn\'t seem to be a way to grab the sessionid as a variable
request.session[\'variable_name\']
Django sessions save their key in a cookie. At least its middleware extracts it like this:
from django.conf import settings session_key = request.COOKIES[settings.SESSION_COOKIE_NAME]