Commit Graph

729 Commits

Author SHA1 Message Date
Andrew Godwin
627b97c317 Fixed #588: enforce_ordering failed to wait on process-specific chans 2017-04-03 13:01:20 +02:00
Andrew Godwin
ba54268c19 Releasing 1.1.2 2017-04-01 15:38:38 +01:00
Mike Barkas
de65a41b54 Issue-579: Fix sentence grammar in documentation. (#580) 2017-03-28 14:00:53 -07:00
Mike Barkas
38bc238788 Issue-443: Adding session decorators to reference documentation. (#578) 2017-03-28 14:00:26 -07:00
Andrew Godwin
28ace41edf Fixed #577: Use scheme key from ASGI request message 2017-03-28 13:37:33 -07:00
Andrew Godwin
476d1500c6 Switch from MD5 to SHA-1 to work under FIPS-140-2 2017-03-28 11:38:05 -07:00
Andrew Godwin
294e60504e Add capacity note about process-local channels. 2017-03-28 10:08:23 -07:00
Andrew Godwin
bbff928152 Update ASGI spec with new process-local channels definition 2017-03-27 19:05:16 -07:00
Matt Magin
df22aa792c Fixed missing keyword argument in testing documentation (#574) 2017-03-27 11:43:14 -07:00
Andrew Godwin
1c5074d128 Specs should be very precise. 2017-03-27 10:06:38 -07:00
Andrew Godwin
a9062e5d28 Further clarify accept flow 2017-03-27 09:59:42 -07:00
Andrew Godwin
cf788a3d7d Allow accept to be False 2017-03-27 09:54:30 -07:00
Flavio Curella
0f0c74daaa Expose WebSocketBridge.socket (#572)
* made `WebSocketBridge._socket` public

We can provide a convenient way to hook custom behavior (such as debugging) by making the underlying `ReconnectingWebSocket` instance publicly available.

Also removed the undocumented `onopen` constructor option.

* recompile js
2017-03-24 15:33:55 -07:00
Erwin Junge
613153cbc6 Allow runworker to be used without staticfiles (#569)
* Allow runworker to be used without staticfiles

* Split too long line

* Reset binding_classes at start of runworker tests
2017-03-23 16:32:51 -07:00
Flavio Curella
10398780a3 Allow relative url in WebsocketBridge.connect() (#567)
* Add support for relative urls in javascript wrapper

* recompile static file

* add js smoke test for relative urls

* update docs to show relative urls
2017-03-23 16:30:28 -07:00
Erwin Junge
4323a64e33 Add python 3.6 checks (#571)
* Add python 3.6 checking to tox

* Add python 3.6 checking to travis
2017-03-23 14:14:15 -07:00
Flavio Curella
9f7fb7b80d remove spurious markdown formatting (#566) 2017-03-23 09:49:17 -07:00
Coread
08ff57ac9b Channel and http session from http (#564)
* Add a new auth decorator to get the user and rehydrate the http session

* Add http_user_and_session, taking precedence over http_user, applying the channel_and_http_session_user_from_http decorator (a superset of http user functionality)

* Only set session cookies on the first send, since subsequent real requests don't have access to HTTP information

* Add a test for new http_user_and_session WebsocketConsumer attribute

* Fix isort check
2017-03-22 15:58:35 -07:00
Andrew Godwin
526ad65e73 A couple more spec tweaks 2017-03-19 12:32:43 -07:00
Andrew Godwin
1f2538f5b8 Few more spec clarifications 2017-03-19 12:26:20 -07:00
Andrew Godwin
528cd89f4e Rearrange ASGI specs into a proper split of messaging/protocols 2017-03-19 12:17:13 -07:00
Andrew Godwin
274a5a8c98 Releasing 1.1.1 2017-03-19 11:23:28 -07:00
Andrew Godwin
08881bc7de Releasing 1.1.0 2017-03-18 13:04:12 -07:00
Flavio Curella
63dc5f6651 add Channels WebSocket javascript wrapper (#544)
Adds a WebSocket wrapper which is both publishable to npm and importable directly for use with staticfiles/etc. Also has a new build process to make the latter file.
2017-03-14 15:08:04 -07:00
Erwin Junge
463d16f3f9 Make the channel_session decorator work on methods as well (#555) 2017-03-14 14:14:20 -07:00
Andrew Godwin
cad63451f8 Expand more on accepting connections 2017-03-12 21:03:44 -07:00
Maik Hoepfel
13c1fcb654 Proposal for minor spec changes (#554)
* Webserver -> web server

This was flagged by my spell check, and indeed it's hard to find
spellings online without the space. The Oxford Dictionary only knows it
with a space, so I thought it's worth correcting.

* Attempt to clarify optional keys

I wasn't sure about how to treat keys marked optional. After having
spoken to Andrew, this is my attempt at clarifying. Improvements
welcome!

* Order of header values MUST be kept

Order for HTTP header values matters, both in request and responses. So
we must make sure that we're keeping it.

Request:
> Some headers, such as Accept-Language can be sent by clients as
> several headers each with a different value rather than sending the
> header as a comma separated list.

http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getHeaders%28java.lang.String%29

Response:
Set-Cookie may be present multiple times, and only the last given value
is to be used.

I'm updating the Daphne test to verify the order in my pull request
there.

* Clarify that headers is a list of lists

The wording for 'server'/'client' and 'headers' was very similar, and I
was unsure if clients may be a list of lists (in anticipation of
protocols supporting that). I hope this small tweak makes it clearer
that only headers is a list of lists.
2017-03-07 23:05:28 -08:00
Doug Keen
2101f285cb Allow custom json encoder and decoder in JsonWebsocketConsumer (#535)
Lets you override the JSON encoding on both the consumer and the multiplexer.
2017-02-28 18:51:48 -08:00
Andrew Godwin
ef6d526359 Add note about installing Redis 2017-02-25 18:12:32 -08:00
Andrew Godwin
c14caede51 Start working on 1.1.0 release notes 2017-02-23 18:01:28 -08:00
Andrew Godwin
b2842f1ef1 Fixed #542: Don't use staticfiles handler if staticfiles is not installed 2017-02-23 17:52:07 -08:00
Pierre Chiquet
7ab21c4846 Set self.kwargs in Binding.trigger_inbound when setting self.message (#541)
Allows options passed in (like a consumer) to be accessible to further code.
2017-02-23 10:17:43 -08:00
Coread
863b1cebdd Requeue next message immediately to avoid wait queue race condition (#532)
Changes the strategy so that after a message has been put on the wait queue, it is then checked to see if it became the next message during this time and if so, immediately flushed. Will hopefully fix #451.
2017-02-22 11:00:50 -08:00
Hassen ben tanfous
db3a020122 Use domain instead of port in docs (#539) 2017-02-20 15:11:28 -08:00
Hassen ben tanfous
7625ed2700 use domain instead of port (#537)
i think this is a typo, as cookies aren't restricted by port, so even if you offload on the same domain, daphne will still work without having to specify a ``session_key`` GET parameter since it can read the django session cookie which it defaults to.
2017-02-19 16:16:37 -08:00
Artem Malyshev
672de2b2a3 Separate tests into own directory. (#531)
* Move project tests to its own directory.

* Install mock test dependency for Python2 only.

* Do not install tox inside tox environment.

* Exclude tests from sdist.

* Use recent pip on Travis-CI.
2017-02-16 10:22:23 -08:00
Хасанов Булат
13472369eb fix tox (#516) 2017-02-14 09:50:01 -08:00
Pierre Chiquet
95c9925fe4 Update Binding to support models with UUIDField as primary key (#528)
* Add custom TestUUIDModel for auto tests

* Update Binding to support models with UUIDField as primary key

Add and fix test_trigger_outbound_create_non_auto_pk.
Before updating pre_save_receiver, this new test failed with this error:

======================================================================
FAIL: test_trigger_outbound_create_non_auto_pk
(channels.tests.test_binding.TestsBinding)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\User\git\contribs\python\channels\channels\tests\test_binding.py", line 85, in test_trigger_outbound_create_non_auto_pk
    self.assertEqual(received['payload']['action'], 'create')
AssertionError: u'update' != u'create'
2017-02-14 09:48:00 -08:00
Pablo Oubiña
4185798731 Typo in Example using class-based consumer (#526)
Typo in Example using class-based consumer from section "2.6.3 WebSocket Multiplexing"
2017-02-11 16:41:36 -08:00
Matthias K
b14bbeebe4 Fix two typos (#521) 2017-02-07 10:20:06 -08:00
Maik Hoepfel
75f668f9e5 Docs: Python 3.3 is not supported any more (#519)
Just a tiny fix to ensure that we don't promise Python 3.3 support.
2017-02-03 10:13:00 -08:00
Andrew Godwin
e189254d54 Typo in changelog 2017-02-01 14:22:54 -08:00
Andrew Godwin
20af4e31b4 Releasing 1.0.3 2017-02-01 12:03:57 -08:00
Maik Hoepfel
6d71106c3c Simplify testing infrastructure (#515)
* Mark runtests helper executable

* Bump required version of asgiref

We're probably making our life easier when we keep the Channels
dependencies roughly in sync. As a 1.0 release was made, I suggest to
require it.

* Simplify tox and Travis configuration

I hopefully simplified the tox configuration by following what I did in
the other four Channels projects.

I then had a good look at tox-travis and decided to remove it. It does
add a layer of indirection with, IMHO, not enough gain. To understand
what Travis is doing, one would need to consider two files (and
understand tox-travis) instead of just one file. It also introduces
another point of failure. What pushed me over was that there's a bug
with env matching (https://github.com/ryanhiebert/tox-travis/issues/55)
and tox or tox-travis seem to mask an Exception
(https://travis-ci.org/django/channels/jobs/195950971#L195) that would
be hard to debug.
The draw back is that we duplicate the Django dependency matrix, and the
commands that are executed in Travis and tox. We could add a "--with-qa"
flag to runtests.py to have it execute flake8 and isort to rectify the
latter.

I extracted test dependencies as I did for asgi_redis.

* Document supported versions
2017-01-30 17:25:07 -08:00
Andrew Godwin
558d66a6b2 Fixed #512: Give rundelay a configurable sleep interval
Also reduced the default interval to 1s.
2017-01-30 17:13:30 -08:00
Andrew Godwin
5fc5267d2a Add code indent 2017-01-27 09:45:41 -08:00
Andrew Godwin
57ed7747f7 Handle slight ordering not being set 2017-01-26 10:47:54 -08:00
Andrew Godwin
a1a1ace23d Remove slight ordering from generics docs 2017-01-26 10:44:08 -08:00
Andrew Godwin
1d1101f7a9 Fixed #509: Docs for enforce_ordering now mirror post-1.0 2017-01-26 10:42:48 -08:00
Andrew Godwin
1a56ae8eb7 Sort imports correctly. 2017-01-25 17:04:06 -08:00