[Python-modules-commits] [python-django-channels] 01/02: importing python-django-channels_1.1.8.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Fri Nov 24 20:00:41 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch debian/master
in repository python-django-channels.
commit 24524c248574ce903a58061849898ebea47096de
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Fri Nov 24 20:30:44 2017 +0100
importing python-django-channels_1.1.8.orig.tar.gz
---
.coveragerc | 23 +
.github/ISSUE_TEMPLATE.md | 15 +
.gitignore | 16 +
.travis.yml | 32 +
CHANGELOG.txt | 421 +++++++++++
CONTRIBUTING.rst | 30 +
LICENSE | 27 +
MANIFEST.in | 2 +
Makefile | 20 +
README.rst | 82 +++
channels/__init__.py | 11 +
channels/apps.py | 19 +
channels/asgi.py | 122 ++++
channels/auth.py | 106 +++
channels/binding/__init__.py | 1 +
channels/binding/base.py | 289 ++++++++
channels/binding/websockets.py | 181 +++++
channels/channel.py | 90 +++
channels/delay/__init__.py | 1 +
channels/delay/apps.py | 8 +
channels/delay/management/__init__.py | 0
channels/delay/management/commands/__init__.py | 0
channels/delay/management/commands/rundelay.py | 44 ++
channels/delay/migrations/0001_initial.py | 25 +
channels/delay/migrations/__init__.py | 0
channels/delay/models.py | 49 ++
channels/delay/worker.py | 91 +++
channels/exceptions.py | 78 ++
channels/generic/__init__.py | 1 +
channels/generic/base.py | 70 ++
channels/generic/websockets.py | 291 ++++++++
channels/hacks.py | 11 +
channels/handler.py | 364 ++++++++++
channels/log.py | 31 +
channels/management/__init__.py | 0
channels/management/commands/__init__.py | 0
channels/management/commands/runserver.py | 177 +++++
channels/management/commands/runworker.py | 88 +++
channels/message.py | 124 ++++
channels/package_checks.py | 30 +
channels/routing.py | 264 +++++++
channels/security/__init__.py | 0
channels/security/websockets.py | 90 +++
channels/sessions.py | 249 +++++++
channels/signals.py | 10 +
channels/static/channels/js/websocketbridge.js | 399 ++++++++++
channels/staticfiles.py | 65 ++
channels/test/__init__.py | 4 +
channels/test/base.py | 232 ++++++
channels/test/http.py | 8 +
channels/test/liveserver.py | 256 +++++++
channels/test/websocket.py | 167 +++++
channels/tests/__init__.py | 8 +
channels/utils.py | 26 +
channels/worker.py | 184 +++++
docs/Makefile | 177 +++++
docs/asgi.rst | 631 ++++++++++++++++
docs/asgi/delay.rst | 26 +
docs/asgi/email.rst | 76 ++
docs/asgi/irc-client.rst | 81 +++
docs/asgi/udp.rst | 48 ++
docs/asgi/www.rst | 453 ++++++++++++
docs/backends.rst | 131 ++++
docs/binding.rst | 168 +++++
docs/community.rst | 18 +
docs/concepts.rst | 273 +++++++
docs/conf.py | 260 +++++++
docs/contributing.rst | 81 +++
docs/delay.rst | 46 ++
docs/deploying.rst | 326 +++++++++
docs/faqs.rst | 177 +++++
docs/generics.rst | 322 ++++++++
docs/getting-started.rst | 807 +++++++++++++++++++++
docs/index.rst | 62 ++
docs/inshort.rst | 114 +++
docs/installation.rst | 42 ++
docs/javascript.rst | 68 ++
docs/make.bat | 242 ++++++
docs/reference.rst | 209 ++++++
docs/releases/1.0.0.rst | 224 ++++++
docs/releases/1.0.1.rst | 16 +
docs/releases/1.0.2.rst | 27 +
docs/releases/1.0.3.rst | 26 +
docs/releases/1.1.0.rst | 35 +
docs/releases/1.1.1.rst | 22 +
docs/releases/1.1.2.rst | 29 +
docs/releases/1.1.3.rst | 26 +
docs/releases/1.1.4.rst | 37 +
docs/releases/1.1.5.rst | 22 +
docs/releases/1.1.6.rst | 23 +
docs/releases/1.1.7.rst | 26 +
docs/releases/1.1.8.rst | 23 +
docs/releases/index.rst | 19 +
docs/routing.rst | 82 +++
docs/testing.rst | 396 ++++++++++
js_client/.babelrc | 10 +
js_client/.eslintrc.js | 9 +
js_client/.npmignore | 8 +
js_client/README.md | 49 ++
js_client/banner.txt | 1 +
js_client/esdoc.json | 21 +
js_client/lib/index.js | 185 +++++
js_client/package.json | 74 ++
js_client/src/index.js | 144 ++++
js_client/tests/websocketbridge.test.js | 152 ++++
loadtesting/2016-09-06/README.rst | 142 ++++
loadtesting/2016-09-06/channels-latency.PNG | Bin 0 -> 70346 bytes
loadtesting/2016-09-06/channels-throughput.PNG | Bin 0 -> 24731 bytes
loadtesting/README.md | 13 +
patchinator.py | 259 +++++++
runtests.py | 16 +
setup.cfg | 16 +
setup.py | 42 ++
testproject/Dockerfile.rabbitmq | 27 +
testproject/Dockerfile.redis | 27 +
testproject/README.rst | 115 +++
testproject/benchmark.py | 224 ++++++
testproject/chtest/__init__.py | 0
testproject/chtest/consumers.py | 7 +
testproject/chtest/models.py | 3 +
testproject/chtest/views.py | 6 +
testproject/docker-compose.rabbitmq.yml | 28 +
testproject/docker-compose.redis.yml | 26 +
testproject/fabfile.py | 67 ++
testproject/locustfile.py | 16 +
testproject/manage.py | 13 +
testproject/requirements.benchmark.txt | 7 +
testproject/requirements.txt | 15 +
testproject/setup.py | 12 +
testproject/testproject/__init__.py | 0
testproject/testproject/asgi/__init__.py | 0
testproject/testproject/asgi/ipc.py | 6 +
testproject/testproject/asgi/rabbitmq.py | 8 +
testproject/testproject/asgi/redis.py | 5 +
testproject/testproject/settings/__init__.py | 1 +
testproject/testproject/settings/base.py | 33 +
testproject/testproject/settings/channels_ipc.py | 13 +
.../testproject/settings/channels_rabbitmq.py | 19 +
testproject/testproject/settings/channels_redis.py | 19 +
testproject/testproject/urls.py | 11 +
testproject/testproject/wsgi.py | 16 +
testproject/testproject/wsgi_no_channels.py | 16 +
tests/__init__.py | 0
tests/a_file | 5 +
tests/models.py | 12 +
tests/settings.py | 30 +
tests/test_asgi.py | 34 +
tests/test_binding.py | 377 ++++++++++
tests/test_delay.py | 137 ++++
tests/test_generic.py | 293 ++++++++
tests/test_handler.py | 355 +++++++++
tests/test_management.py | 232 ++++++
tests/test_request.py | 244 +++++++
tests/test_routing.py | 348 +++++++++
tests/test_security.py | 44 ++
tests/test_sessions.py | 387 ++++++++++
tests/test_worker.py | 95 +++
tests/test_wsclient.py | 123 ++++
tox.ini | 17 +
159 files changed, 15417 insertions(+)
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..3f06bb6
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,23 @@
+[run]
+branch = True
+source = channels
+omit = tests/*
+
+[report]
+show_missing = True
+skip_covered = True
+omit = tests/*
+
+[html]
+directory = coverage_html
+
+[paths]
+django_19 =
+ .tox/py27-django-18/lib/python2.7
+ .tox/py34-django-18/lib/python3.4
+ .tox/py35-django-18/lib/python3.5
+
+django_18 =
+ .tox/py27-django-19/lib/python2.7
+ .tox/py34-django-19/lib/python3.4
+ .tox/py35-django-19/lib/python3.5
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..9820316
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,15 @@
+Please submit **questions** about usage to django-users at googlegroups.com (https://groups.google.com/forum/#!forum/django-users) and about development to django-developers at googlegroups.com (https://groups.google.com/forum/#!forum/django-developers).
+
+If you're submitting a feature request, please try to include:
+
+- Detailed description of the overall behaviour
+- Reasoning why it should be in Channels rather than a third-party app
+- Examples of usage, if possible (it's easier to discuss concrete code examples)
+
+If you're submitting a bug report, please include:
+
+- Your OS and runtime environment, and browser if applicable
+- The versions of Channels, Daphne, Django, Twisted, and your ASGI backend (asgi_ipc or asgi_redis normally)
+- What you expected to happen vs. what actually happened
+- How you're running Channels (runserver? daphne/runworker? Nginx/Apache in front?)
+- Console logs and full tracebacks of any errors
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8736ba0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+*.egg-info
+dist/
+build/
+docs/_build
+__pycache__/
+*.sqlite3
+.tox/
+*.swp
+*.pyc
+.coverage.*
+TODO
+node_modules
+
+# IDE and Tooling files
+.idea/*
+*~
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..2c4da6b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,32 @@
+sudo: false
+dist: trusty
+
+language: python
+
+python:
+ - "2.7"
+ - "3.4"
+ - "3.5"
+ - "3.6"
+
+env:
+ - DJANGO="Django>=1.8,<1.9"
+ - DJANGO="Django>=1.9,<1.10"
+ - DJANGO="Django>=1.10,<1.11"
+ - DJANGO="Django>=1.11,<2.0"
+
+cache:
+ directories:
+ - $HOME/.cache/pip/wheels
+
+install:
+ - nvm install 7
+ - pip install -U pip wheel setuptools
+ - pip install $DJANGO -e .[tests]
+ - pip freeze
+
+script:
+ - python runtests.py
+# - cd js_client && npm install --progress=false && npm test && cd ..
+ - flake8
+ - isort --check-only --recursive channels
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
new file mode 100644
index 0000000..0f50233
--- /dev/null
+++ b/CHANGELOG.txt
@@ -0,0 +1,421 @@
+Full release notes, with more details and upgrade information, are available at:
+https://channels.readthedocs.io/en/latest/releases
+
+
+1.1.8 (2017-09-15)
+------------------
+
+* Reverted recent JS fixes for subprotocols on some phones as they do not work
+ in Chrome.
+
+
+1.1.7 (2017-09-14)
+------------------
+
+* Fixed compatability with Django 1.10 and below
+
+* JS library: Fixed error with 1006 error code
+
+
+1.1.6 (2017-06-28)
+------------------
+
+* The ``runserver`` ``server_cls`` override no longer fails with more modern
+ Django versions that pass an ``ipv6`` parameter.
+
+
+1.1.5 (2017-06-16)
+------------------
+
+* The Daphne dependency requirement was bumped to 1.3.0.
+
+
+1.1.4 (2017-06-15)
+------------------
+
+* Pending messages correctly handle retries in backlog situations
+
+* Workers in threading mode now respond to ctrl-C and gracefully exit.
+
+* ``request.meta['QUERY_STRING']`` is now correctly encoded at all times.
+
+* Test client improvements
+
+* ``ChannelServerLiveTestCase`` added, allows an equivalent of the Django
+ ``LiveTestCase``.
+
+* Decorator added to check ``Origin`` headers (``allowed_hosts_only``)
+
+* New ``TEST_CONFIG`` setting in ``CHANNEL_LAYERS`` that allows varying of
+ the channel layer for tests (e.g. using a different Redis install)
+
+
+1.1.3 (2017-04-05)
+------------------
+
+* ``enforce_ordering`` now works correctly with the new-style process-specific
+ channels
+
+* ASGI channel layer versions are now explicitly checked for version compatability
+
+
+1.1.2 (2017-04-01)
+------------------
+
+* Session name hash changed to SHA-1 to satisfy FIPS-140-2. Due to this,
+ please force all WebSockets to reconnect after the upgrade.
+
+* `scheme` key in ASGI-HTTP messages now translates into `request.is_secure()`
+ correctly.
+
+* WebsocketBridge now exposes the underlying WebSocket as `.socket`
+
+
+1.1.1 (2017-03-19)
+------------------
+
+* Fixed JS packaging issue
+
+
+1.1.0 (2017-03-18)
+------------------
+
+* Channels now includes a JavaScript wrapper that wraps reconnection and
+ multiplexing for you on the client side.
+
+* Test classes have been moved from ``channels.tests`` to ``channels.test``.
+
+* Bindings now support non-integer fields for primary keys on models.
+
+* The ``enforce_ordering`` decorator no longer suffers a race condition where
+ it would drop messages under high load.
+
+* ``runserver`` no longer errors if the ``staticfiles`` app is not enabled in Django.
+
+
+1.0.3 (2017-02-01)
+------------------
+
+* Database connections are no longer force-closed after each test is run.
+
+* Channel sessions are not re-saved if they're empty even if they're marked as
+ modified, allowing logout to work correctly.
+
+* WebsocketDemultiplexer now correctly does sessions for the second/third/etc.
+ connect and disconnect handlers.
+
+* Request reading timeouts now correctly return 408 rather than erroring out.
+
+* The ``rundelay`` delay server now only polls the database once per second,
+ and this interval is configurable with the ``--sleep`` option.
+
+
+1.0.2 (2017-01-12)
+------------------
+
+* Websockets can now be closed from anywhere using the new ``WebsocketCloseException``.
+ There is also a generic ``ChannelSocketException`` so you can do custom behaviours.
+
+* Calling ``Channel.send`` or ``Group.send`` from outside a consumer context
+ (i.e. in tests or management commands) will once again send the message immediately.
+
+* The base implementation of databinding now correctly only calls ``group_names(instance)``,
+ as documented.
+
+
+1.0.1 (2017-01-09)
+------------------
+
+* WebSocket generic views now accept connections by default in their connect
+ handler for better backwards compatibility.
+
+
+1.0.0 (2017-01-08)
+------------------
+
+* BREAKING CHANGE: WebSockets must now be explicitly accepted or denied.
+ See https://channels.readthedocs.io/en/latest/releases/1.0.0.html for more.
+
+* BREAKING CHANGE: Demultiplexers have been overhauled to directly dispatch
+ messages rather than using channels to new consumers. Consult the docs on
+ generic consumers for more: https://channels.readthedocs.io/en/latest/generics.html
+
+* BREAKING CHANGE: Databinding now operates from implicit group membership,
+ where your code just has to say what groups would be used and Channels will
+ work out if it's a creation, modification or removal from a client's
+ perspective, including with permissions.
+
+* Delay protocol server ships with Channels providing a specification on how
+ to delay jobs until later and a reference implementation.
+
+* Serializers can now specify fields as `__all__` to auto-include all fields.
+
+* Various other small fixes.
+
+0.17.3 (2016-10-12)
+-------------------
+
+* channel_session now also rehydrates the http session with an option
+
+* request.META['PATH_INFO'] is now present
+
+* runserver shows Daphne log messages
+
+* runserver --nothreading only starts a single worker thread
+
+* Databinding changed to call group_names dynamically and imply changed/created from that;
+ other small changes to databinding, and more changes likely.
+
+
+0.17.2 (2016-08-04)
+-------------------
+
+* New CHANNELS_WS_PROTOCOLS setting if you want Daphne to accept certain
+ subprotocols
+
+* WebsocketBindingWithMembers allows serialization of non-fields on instances
+
+* Class-based consumers have an .as_route() method that lets you skip using
+ route_class
+
+* Bindings now work if loaded after app ready state
+
+
+0.17.1 (2016-07-22)
+-------------------
+
+* Bindings now require that `fields` is defined on the class body so all fields
+ are not sent by default. To restore old behaviour, set it to ['__all__']
+
+* Bindings can now be declared after app.ready() has been called and still work.
+
+* Binding payloads now include the model name as `appname.modelname`.
+
+* A worker_ready signal now gets triggered when `runworker` starts consuming
+ messages. It does not fire from within `runserver`.
+
+
+0.17.0 (2016-07-19)
+-------------------
+
+* Data Binding framework is added, which allows easy tying of model changes
+ to WebSockets (and other protocols) and vice-versa.
+
+* Standardised WebSocket/JSON multiplexing introduced
+
+* WebSocket generic consumers now have a 'close' argument on send/group_send
+
+
+0.16.1 (2016-07-12)
+-------------------
+
+* WebsocketConsumer now has a http_user option for auto user sessions.
+
+* consumer_started and consumer_finished signals are now available under
+ channels.signals.
+
+* Database connections are closed whenever a consumer finishes.
+
+
+0.16.0 (2016-07-06)
+-------------------
+
+* websocket.connect and websocket.receive are now consumed by a no-op consumer
+ by default if you don't specify anything to consume it, to bring Channels in
+ line with the ASGI rules on WebSocket backpressure.
+
+* You no longer need to call super's setUp in ChannelTestCase.
+
+
+0.15.1 (2016-06-29)
+-------------------
+
+* Class based consumers now have a self.kwargs
+
+* Fixed bug where empty streaming responses did not send headers or status code
+
+
+0.15.0 (2016-06-22)
+-------------------
+
+* Query strings are now decoded entirely by Django. Must be used with Daphne
+ 0.13 or higher.
+
+
+0.14.3 (2016-06-21)
+-------------------
+
+* + signs in query strings are no longer double-decoded
+
+* Message now has .values(), .keys() and .items() to match dict
+
+
+0.14.2 (2016-06-16)
+-------------------
+
+* Class based consumers now have built-in channel_session and
+ channel_session_user support
+
+
+0.14.1 (2016-06-09)
+-------------------
+
+* Fix unicode issues with test client under Python 2.7
+
+
+0.14.0 (2016-05-25)
+-------------------
+
+* Class-based consumer pattern and WebSocket consumer now come with Channels
+ (see docs for more details)
+
+* Better testing utilities including a higher-level Client abstraction with
+ optional HTTP/WebSocket HttpClient variant.
+
+
+0.13.1 (2016-05-13)
+-------------------
+
+* enforce_ordering now queues future messages in a channel rather than
+ spinlocking worker processes to achieve delays.
+
+* ConsumeLater no longer duplicates messages when they're requeued below the
+ limit.
+
+
+0.13.0 (2016-05-07)
+-------------------
+
+* Backpressure is now implemented, meaning responses will pause sending if
+ the client does not read them fast enough.
+
+* DatabaseChannelLayer has been removed; it was not sensible.
+
+
+0.12.0 (2016-04-26)
+-------------------
+
+* HTTP paths and query strings are now expected to be sent over ASGI as
+ unescaped unicode. Daphne 0.11.0 is updated to send things in this format.
+
+* request.FILES reading bug fixed
+
+
+0.11.0 (2016-04-05)
+-------------------
+
+* ChannelTestCase base testing class for easier testing of consumers
+
+* Routing rewrite to improve speed with nested includes and remove need for ^ operator
+
+* Timeouts reading very slow request bodies
+
+
+0.10.3 (2016-03-29)
+-------------------
+
+* Better error messages for wrongly-constructed routing lists
+
+* Error when trying to use signed cookie backend with channel_session
+
+* ASGI group_expiry implemented on database channel backend
+
+
+0.10.2 (2016-03-23)
+-------------------
+
+* Regular expressions for routing include() can now be Unicode under Python 3
+
+* Last-resort error handling for HTTP request exceptions inside Django's core
+ code. If DEBUG is on, shows plain text tracebacks; if it is off, shows
+ "Internal Server Error".
+
+
+0.10.1 (2016-03-22)
+-------------------
+
+* Regular expressions for HTTP paths can now be Unicode under Python 3
+
+* route() and include() now importable directly from `channels`
+
+* FileResponse send speed improved for all code (previously just for staticfiles)
+
+
+0.10.0 (2016-03-21)
+-------------------
+
+* New routing system
+
+* Updated to match new ASGI single-reader-channel name spec
+
+* Updated to match new ASGI HTTP header encoding spec
+
+
+0.9.5 (2016-03-10)
+------------------
+
+* `runworker` now has an --alias option to specify a different channel layer
+
+* `runserver` correctly falls back to WSGI mode if no channel layers configured
+
+
+0.9.4 (2016-03-08)
+------------------
+
+* Worker processes now exit gracefully (finish their current processing) when
+ sent SIGTERM or SIGINT.
+
+* `runserver` now has a shorter than standard HTTP timeout configured
+ of 60 seconds.
+
+
+0.9.3 (2016-02-28)
+------------------
+
+* Static file serving is significantly faster thanks to larger chunk size
+
+* `runworker` now refuses to start if an in memory layer is configured
+
+
+0.9.2 (2016-02-28)
+------------------
+
+* ASGI spec updated to include `order` field for WebSocket messages
+
+* `enforce_ordering` decorator introduced
+
+* DatabaseChannelLayer now uses transactions to stop duplicated messages
+
+
+0.9.1 (2016-02-21)
+------------------
+
+* Fix packaging issues with previous release
+
+
+0.9 (2016-02-21)
+----------------
+
+* Staticfiles support in runserver
+
+* Runserver logs requests and WebSocket connections to console
+
+* Runserver autoreloads correctly
+
+* --noasgi option on runserver to use the old WSGI-based server
+
+* --noworker option on runserver to make it not launch worker threads
+
+* Streaming responses work correctly
+
+* Authentication decorators work again with new ASGI spec
+
+* channel_session_user_from_http decorator introduced
+
+* HTTP Long Poll support (raise ResponseLater)
+
+* Handle non-latin1 request body encoding
+
+* ASGI conformance tests for built-in database backend
+
+* Moved some imports around for more sensible layout
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
new file mode 100644
index 0000000..c5b62ac
--- /dev/null
+++ b/CONTRIBUTING.rst
@@ -0,0 +1,30 @@
+Contributing to Channels
+========================
+
+As an open source project, Channels welcomes contributions of many forms. By participating in this project, you
+agree to abide by the Django `code of conduct <https://www.djangoproject.com/conduct/>`_.
+
+Examples of contributions include:
+
+* Code patches
+* Documentation improvements
+* Bug reports and patch reviews
+
+For more information, please see our `contribution guide <https://channels.readthedocs.io/en/latest/contributing.html>`_.
+
+Quick Setup
+-----------
+
+Fork, then clone the repo:
+
+ git clone git at github.com:your-username/channels.git
+
+Make sure the tests pass:
+
+ tox
+
+Make your change. Add tests for your change. Make the tests pass:
+
+ tox
+
+Push to your fork and `submit a pull request <https://github.com/django/channels/compare/>`_.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5f4f225
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) Django Software Foundation and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of Django nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..100f6b7
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+recursive-exclude tests *
+include channels/static/channels/js/*
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..612ab19
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+.PHONY: release
+
+all:
+
+build_assets:
+ cd js_client && npm run browserify && cd ..
+
+release:
+ifndef version
+ $(error Please supply a version)
+endif
+ @echo Releasing version $(version)
+ifeq (,$(findstring $(version),$(shell git log --oneline -1)))
+ $(error Last commit does not match version)
+endif
+ git tag $(version)
+ git push
+ git push --tags
+ python setup.py sdist bdist_wheel upload
+ cd js_client && npm publish && cd ..
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..f398c12
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,82 @@
+Django Channels
+===============
+
+.. image:: https://api.travis-ci.org/django/channels.svg
+ :target: https://travis-ci.org/django/channels
+
+.. image:: https://readthedocs.org/projects/channels/badge/?version=latest
+ :target: https://channels.readthedocs.io/en/latest/?badge=latest
+
+.. image:: https://img.shields.io/pypi/v/channels.svg
+ :target: https://pypi.python.org/pypi/channels
+
+.. image:: https://img.shields.io/pypi/l/channels.svg
+ :target: https://pypi.python.org/pypi/channels
+
+Channels loads into Django as a pluggable app to bring WebSocket, long-poll HTTP,
+task offloading and other asynchrony support to your code, using familiar Django
+design patterns and a flexible underlying framework that lets you not only
+customize behaviours but also write support for your own protocols and needs.
+
+Documentation, installation and getting started instructions are at
+https://channels.readthedocs.io
+
+Channels is an official Django Project and as such has a deprecation policy.
+Details about what's deprecated or pending deprecation for each release is in
+the `release notes <http://channels.readthedocs.io/en/latest/releases/index.html>`_.
+
+Support can be obtained either here via issues, or in the ``#django-channels``
+channel on Freenode.
+
+You can install channels from PyPI as the ``channels`` package.
+You'll likely also want to install ``asgi_redis`` or ``asgi_rabbitmq``
+to provide the Redis/RabbitMQ channel layer correspondingly.
+See our `installation <https://channels.readthedocs.io/en/latest/installation.html>`_
+and `getting started <https://channels.readthedocs.io/en/latest/getting-started.html>`_ docs for more.
+
+Dependencies
+------------
+
+All Channels projects currently support Python 2.7, 3.4 and 3.5. `channels` supports all released
+Django versions, namely 1.8-1.10.
+
+
+Contributing
+------------
+
+To learn more about contributing, please `read our contributing docs <https://channels.readthedocs.io/en/latest/contributing.html>`_.
+
+
+Maintenance and Security
+------------------------
+
+To report security issues, please contact security at djangoproject.com. For GPG
+signatures and more security process information, see
+https://docs.djangoproject.com/en/dev/internals/security/.
+
+To report bugs or request new features, please open a new GitHub issue. For
+larger discussions, please post to the
+`django-developers mailing list <https://groups.google.com/d/forum/django-developers>`_.
+
+Django Core Shepherd: Andrew Godwin <andrew at aeracode.org>
+
+Maintenance team:
+
+* Andrew Godwin <andrew at aeracode.org>
+* Artem Malyshev <proofit404 at gmail.com>
+
+If you are interested in joining the maintenance team, please
+`read more about contributing <https://channels.readthedocs.io/en/latest/contributing.html>`_
+and get in touch!
+
+
+Other Projects
+--------------
+
+The Channels project is made up of several packages; the others are:
+
+* `Daphne <https://github.com/django/daphne/>`_, the HTTP and Websocket termination server
+* `asgiref <https://github.com/django/asgiref/>`_, the base ASGI library/memory backend
+* `asgi_redis <https://github.com/django/asgi_redis/>`_, the Redis channel backend
+* `asgi_rabbitmq <https://github.com/proofit404/asgi_rabbitmq/>`_, the RabbitMQ channel backend
+* `asgi_ipc <https://github.com/django/asgi_ipc/>`_, the POSIX IPC channel backend
diff --git a/channels/__init__.py b/channels/__init__.py
new file mode 100644
index 0000000..5430057
--- /dev/null
+++ b/channels/__init__.py
@@ -0,0 +1,11 @@
+__version__ = "1.1.8"
+
+default_app_config = 'channels.apps.ChannelsConfig'
+DEFAULT_CHANNEL_LAYER = 'default'
+
+try:
+ from .asgi import channel_layers # NOQA isort:skip
+ from .channel import Channel, Group # NOQA isort:skip
+ from .routing import route, route_class, include # NOQA isort:skip
+except ImportError: # No django installed, allow vars to be read
+ pass
diff --git a/channels/apps.py b/channels/apps.py
new file mode 100644
index 0000000..36fc9a0
--- /dev/null
+++ b/channels/apps.py
@@ -0,0 +1,19 @@
+from django.apps import AppConfig
+
+from .binding.base import BindingMetaclass
+from .package_checks import check_all
+
+
+class ChannelsConfig(AppConfig):
+
+ name = "channels"
+ verbose_name = "Channels"
+
+ def ready(self):
+ # Check versions
+ check_all()
+ # Do django monkeypatches
+ from .hacks import monkeypatch_django
+ monkeypatch_django()
+ # Instantiate bindings
+ BindingMetaclass.register_all()
diff --git a/channels/asgi.py b/channels/asgi.py
new file mode 100644
index 0000000..132553d
--- /dev/null
+++ b/channels/asgi.py
@@ -0,0 +1,122 @@
+from __future__ import unicode_literals
+
+import django
+from django.conf import settings
+from django.utils.module_loading import import_string
+
+from .routing import Router
+from .utils import name_that_thing
+
+
+class InvalidChannelLayerError(ValueError):
+ pass
+
+
+class ChannelLayerManager(object):
+ """
+ Takes a settings dictionary of backends and initialises them on request.
+ """
+
+ def __init__(self):
+ self.backends = {}
+
+ @property
+ def configs(self):
+ # Lazy load settings so we can be imported
+ return getattr(settings, "CHANNEL_LAYERS", {})
+
+ def make_backend(self, name):
+ """
+ Instantiate channel layer.
+ """
+ config = self.configs[name].get("CONFIG", {})
+ return self._make_backend(name, config)
+
+ def make_test_backend(self, name):
+ """
+ Instantiate channel layer using its test config.
+ """
+ try:
+ config = self.configs[name]["TEST_CONFIG"]
+ except KeyError:
+ raise InvalidChannelLayerError("No TEST_CONFIG specified for %s" % name)
+ return self._make_backend(name, config)
+
+ def _make_backend(self, name, config):
+ # Load the backend class
+ try:
+ backend_class = import_string(self.configs[name]['BACKEND'])
+ except KeyError:
+ raise InvalidChannelLayerError("No BACKEND specified for %s" % name)
+ except ImportError:
+ raise InvalidChannelLayerError(
+ "Cannot import BACKEND %r specified for %s" % (self.configs[name]['BACKEND'], name)
+ )
+ # Get routing
+ try:
+ routing = self.configs[name]['ROUTING']
... 15507 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django-channels.git
More information about the Python-modules-commits
mailing list