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()
import os
from setuptools import find_packages, setup
from daphne import __version__
# We use the README as the long_description
readme_path = os.path.join(os.path.dirname(__file__), "README.rst")
with open(readme_path) as fp:
long_description = fp.read()
setup(
name="daphne",
version=__version__,
url="https://github.com/django/daphne",
author="Django Software Foundation",
author_email="foundation@djangoproject.com",
description="Django ASGI (HTTP/WebSocket) server",
long_description=long_description,
license="BSD",
zip_safe=False,
package_dir={"twisted": "daphne/twisted"},
packages=find_packages() + ["twisted.plugins"],
include_package_data=True,
install_requires=["twisted[tls]>=18.7", "autobahn>=0.18", "asgiref~=3.2"],
setup_requires=["pytest-runner"],
extras_require={
"tests": ["hypothesis==4.23", "pytest~=3.10", "pytest-asyncio~=0.8"]
},
entry_points={