This seems an odd way to pass the config. Instead I would suggest having it put into S3 global
So the view template would have:
s3.js_global.append('''S3.chat_url={{{settings.get_chat_url()}}}'''
& the static would have:
bosh_service_url: S3.chat_url