Commit Graph

702 Commits

Author SHA1 Message Date
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
Andrew Godwin
ef755e4c9d Remove optional multiplexer arg in generics docs 2017-01-25 17:03:09 -08:00
Andrew Godwin
9ae27cb835 Fixed #462: Don't actually close DB connections during tests 2017-01-25 16:59:35 -08:00
Andrew Godwin
9942c59851 Fixed #505: Add classifiers to setup.py 2017-01-24 09:57:38 -08:00
Andrew Godwin
db8a4570c3 Fixed #477: Only re-save session if it's not empty 2017-01-24 09:57:38 -08:00
Malyshev Artem
5c74ee587e Installable benchmark package. (#501)
* Make benchmark installable module.

* Use passed url in the Benchmarker constructor.

* Correct percentile output.

* Import reactor globally.

Since it used in the benchmarker.
2017-01-23 22:04:42 -08:00
Lars Kreisz
1542343392 Fix typo (#500) 2017-01-23 12:00:05 -08:00
Andrew Godwin
891eaf0051 Talk about URL routing/views in getting started (refs #92) 2017-01-23 10:13:36 -08:00
Gary Reynolds
f4d38ef778 Remove unnecessary profane word in the documentation (#499) 2017-01-22 23:32:04 -08:00
Andrew Godwin
e07389eadb Fixed #496: Update readme to remove beta info 2017-01-22 11:05:19 -08:00
Leon Koole
044c422cdd Remove unnecessary http_session_user import (#493) 2017-01-20 17:23:21 -08:00
Joseph Ryan
1e2cd8ec76 Fix for session shenanigans with WebsocketDemultiplexer (#486)
* Fix for session shenanigans with WebsocketDemultiplexer

Session data was getting lost in the demux due to the session getting
saved after only the first connect/disconnect consumer was run.

* fix for flake8

* flake8 again

flake8 again
2017-01-17 16:20:08 -08:00
Malyshev Artem
335cd1625e Correct benchmark test for recent channels version. (#487)
* Ignore Emacs backups.

* Do not override default websocket.connect handler.

Channels specification 1.0 requires that websocket.connect handler
returns meaningful message with {'accept': True} at least.

* Add rabbitmq channel layer settings.

* Add benchmark requirements in separate file.

* Add RabbitMQ infrastructure part.

* Adapt benchmark README for new docker layout.

* Adapt fabric deploy for new settings module.
2017-01-17 12:25:08 -08:00
Andrew Godwin
fd30bff5de Fixed #483: HttpResponse takes "status", not "status_code" 2017-01-13 09:32:41 -08:00
Andrew Godwin
811d017dc9 Releasing 1.0.2 2017-01-12 10:12:09 -08:00
Andrew Godwin
c9e6472ca7 Update changelogs for 1.0.2 and web in general 2017-01-12 10:09:36 -08:00
Andrew Godwin
05b5fa5216 Fixed #482: Group_names not updated right in base classes. 2017-01-12 10:09:36 -08:00
Krukov D
37da462411 User friendly way to close websocket with code (via CloseException) (#468)
* User friendly way to close websocket with status

* More generic way  to close(whatever) connection by exception

* Fix import ordering for exceptions (isort)
2017-01-12 10:02:30 -08:00
Andrew Godwin
2ced4ee2e9 Remove consumer_finished from tests that flushed
No longer needed now messages aren't buffered outside consumers.
2017-01-11 15:40:24 -08:00
Andrew Godwin
69c59ee8b4 Fixed #481: Sends from outside consumers send immediately 2017-01-11 15:35:50 -08:00
Bartek Ogryczak
ee4aa9b292 more consistent metrics (#473)
* more consistent metrics

More consistent metrics, in particular for consumers such as Graphite, CloudWatch etc. you don't want aggregated numbers per second, you want number since previous call. Since we don't want to track all the clients, total since start is the next best thing, because it can be easily calculated by the metrics consumer `count_since_last = pervious_count - current_count`

* changing 'queue_depth' to 'messages_pending', also making 'messages' plurar for 'max_age' to keep it consitent
2017-01-11 11:49:59 -08:00
Andrew Godwin
6bfaaf23d1 Add connect-accept into Websocket CBC example (#479) 2017-01-11 11:38:21 -08:00
Krukov D
b84713b20e Remove unicode literals (#476) 2017-01-11 10:03:03 -08:00
Adam Johnson
08f0a0934c Use HTTPS in changelog (#472)
security ++
2017-01-10 10:05:23 -08:00
Andrew Godwin
2650505eab Releasing 1.0.1 2017-01-09 22:10:18 -08:00
Krukov D
8a93dfc401 Accept Connection at WebsocketConsumer (#467)
* Added accept at default behavior for websocket generic cbv and pass message instead of dict

* Fix flake8

* Use HttpClient Instead of Client

* Fix lsort
2017-01-09 10:08:00 -08:00
Andrew Godwin
827fcd25b1 Releasing 1.0.0 2017-01-08 18:37:03 -08:00
Andrew Godwin
c0ba284bbb Fix import ordering 2017-01-08 18:33:31 -08:00