Skip to content

Commit

Permalink
Use a real session store for request.session.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephrdev committed Feb 5, 2021
1 parent 6a6a9ce commit b001d4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion static_templates/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.sessions.backends.signed_cookies import SessionStore
from django.template import RequestContext
from django.template.loader import render_to_string
from django.test.client import RequestFactory
Expand Down Expand Up @@ -60,7 +61,7 @@ def render_template(self):
# apply all context processors (for menus, etc.)
request = RequestFactory(HTTP_HOST=settings.ALLOWED_HOSTS[0].strip('.')).get('/')
request.user = AnonymousUser()
request.session = {}
request.session = SessionStore()

template_name = self.get_template_name()
self.log('Rendering template "{0}"'.format(template_name))
Expand Down

0 comments on commit b001d4a

Please sign in to comment.