Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def serve_daphne(self, host, port, **kwargs):
util.ensure_pip("daphne")
import daphne.server
import daphne.cli
self.server_version = daphne.__version__
app_asgi = build_asgi_i(self)
app_daphne = daphne.cli.ASGI3Middleware(app_asgi)
self._server = daphne.server.Server(
app_daphne,
endpoints = ["tcp:port=%d:interface=%s" % (port, host)]
)
self._server.run()