Django Store Engine and Celery

Can I use django.contrib.sessions.backends.db with Celery in my Django project?

I ask this because when I execute login(request, user, user.backend), request's session_key is not stored inside DjangoSession table.

this is the piece of code:

engine = import_module(settings.SESSION_ENGINE)

# Create a fake request to store login details.
request = HttpRequest()

request.session = engine.SessionStore()
login(request, user, user.backend)

# Save the session values.
Back to Top