Skip to content

Commit

Permalink
Make runserver work using daphne
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgodwin committed Jan 3, 2016
1 parent b9464ca commit 836f6be
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 1,031 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Django Channels
===============

**NOTE: The current master branch is in flux as it changes to match the final
structure and the new ASGI spec. If you wish to use this in the meantime,
please use a tagged release.**

This is a work-in-progress code branch of Django implemented as a third-party
app, which aims to bring some asynchrony to Django and expand the options
for code beyond the request-response model, in particular enabling WebSocket,
Expand Down
36 changes: 0 additions & 36 deletions channels/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -1,36 +0,0 @@
from django.utils.module_loading import import_string


class InvalidChannelBackendError(ValueError):
pass


class BackendManager(object):
"""
Takes a settings dictionary of backends and initialises them.
"""

def __init__(self, backend_configs):
self.configs = backend_configs
self.backends = {}

def make_backend(self, name):
# Load the backend class
try:
backend_class = import_string(self.configs[name]['BACKEND'])
except KeyError:
raise InvalidChannelBackendError("No BACKEND specified for %s" % name)
except ImportError:
raise InvalidChannelBackendError(
"Cannot import BACKEND %r specified for %s" % (self.configs[name]['BACKEND'], name)
)

# Initialise and pass config
instance = backend_class(**{k.lower(): v for k, v in self.configs[name].items() if k != "BACKEND"})
instance.alias = name
return instance

def __getitem__(self, key):
if key not in self.backends:
self.backends[key] = self.make_backend(key)
return self.backends[key]
109 changes: 0 additions & 109 deletions channels/backends/base.py

This file was deleted.

102 changes: 0 additions & 102 deletions channels/backends/memory.py

This file was deleted.

Loading

0 comments on commit 836f6be

Please sign in to comment.