Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def import_from_path(path):
try:
module_path, attr = path.rsplit('.', 1)
module = import_module(module_path)
obj = getattr(module, attr)
except Exception as e:
raise e
return obj
def get_session_store():
mod = getattr(settings, 'SESSION_ENGINE', 'django.contrib.sessions.backends.db')
engine = import_module(mod)
store = engine.SessionStore()
return store