def global_context(request):
 context = {'WITH_WS4REDIS': hasattr(settings, 'WEBSOCKET_URL')}
 return context

def global_context ( request ) : context = { 'WITH_WS4REDIS' : hasattr ( settings , 'WEBSOCKET_URL' ) } return context
adds additional context variables to the default context .