Commit Graph

639 Commits

Author SHA1 Message Date
Sam Bolgert
b115f8fa04 Update channel_session decorator to rehydrate http_session (#348)
* Update channel_session decorator to rehydrate http_session

Update the http_session decorator to write the http session key
to the channel_session when available. This allows the channel_session
decorator to rehydrate the http_session after the initial websocket
connection.

closes #318

* Add persist=True option to http_session

* Add explicit option to store the session key in the channel session
* Update docs
* Add test case

* Add channel_and_http_session decorator

This decorator enables both sessions and maintains
the http_session for the lifetime of the websocket connection.
2016-09-29 11:08:44 -07:00
Carles Barrobés
d4f7125cd5 Fix type for request.META['SERVER_PORT'] (#378)
Django documentation states that it is a string.
Fixes #366
2016-09-23 11:37:45 -07:00
Adam Chainz
eaaf70e935 Convert readthedocs link for their .org -> .io migration for hosted projects (#374)
As per [their blog post of the 27th April](https://blog.readthedocs.com/securing-subdomains/) ‘Securing subdomains’:

> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.

Test Plan: Manually visited all the links I’ve modified.
2016-09-22 14:17:39 -07:00
Benjamin Bach
06fd1f8ada Add conventional request.META['PATH_INFO'] - fixes benjaoming/django-nyt#27 (#375) 2016-09-22 13:57:30 -07:00
Andrew Godwin
58cc3c845d Onopen timing fixes in docs 2016-09-15 10:23:59 -07:00
benny daon
8e84c0ce87 reply and response are confusing (#361)
I'm not sure I got it right, but based on the attribute name, `response` belong to the HTTP domain and `reply` to the channel domain.
2016-09-14 05:57:23 +01:00
qwitwa
d1590afdcb Fix typo in code in models section (#319)
Changed channel_session['room'] inside websockets consumer function to message.channel_session['room']
2016-09-12 11:59:46 +01:00
Krukov D
5464cba742 Iimprovements for test client (#352)
* Json encoding only for not string text at HttpClient

* Decode received content if possible

* Check that content received

* Using json kwarg at receive method to decode message text content

* Wrap decorator function at channel_session_user_from_http

* Cleanup

* Arbitrary indent. sorry
2016-09-12 11:28:12 +01:00
Krukov D
075897d910 Inbound tests (#351)
* Added groups as Binding attr for easy groups_names definition

* Binding: inbound - updating fields that only in fields attribute

* Added tests for inbound part of binding #343

* Fix for flake8 checker

* Revert "Added groups as Binding attr for easy groups_names definition"

This reverts commit 009b4adbee534d4ccbea191ce2523a0edb09d407.

* Using group_names at inbound tests
2016-09-12 11:27:42 +01:00
Michael Angeletti
e176e913d8 Fix URL typo (#359) 2016-09-12 11:25:05 +01:00
Krukov D
be14c14783 Add django1.10 to the list of tests env (#353) 2016-09-11 11:28:44 +01:00
Andrew Godwin
9618440e6d Fix generics docs 2016-09-11 11:00:45 +01:00
Naveen Yadav
5e0add6bbb sessions and users doc updated (#354) 2016-09-11 10:58:06 +01:00
Andrew Godwin
b46c511b13 Clarify where overall tasks live 2016-09-09 14:47:34 +01:00
Andrew Godwin
b27384933f Move ChannelsTasks wiki content into the docs 2016-09-09 14:46:55 +01:00
Andrew Godwin
6a17caad5b I really need to stop indenting unordered lists 2016-09-09 14:22:53 +01:00
Andrew Godwin
f805096bd5 Crosslink other channels projects 2016-09-09 14:22:23 +01:00
Andrew Godwin
f79ecbff6d Tidy up main README a bit more 2016-09-09 13:38:38 +01:00
Andrew Godwin
971d3fc8d0 Django-ification 2016-09-09 13:29:12 +01:00
Andrew Godwin
21f0aeaf64 Mention mailing list 2016-09-09 12:59:45 +01:00
Andrew Godwin
67f6638e90 More of a contribution CTA 2016-09-09 12:58:19 +01:00
Andrew Godwin
d7f71be6e1 Fix RST formatting 2016-09-09 12:57:02 +01:00
Andrew Godwin
f21bec56a1 Add maintenance and security README 2016-09-09 12:51:35 +01:00
Andrew Godwin
df40081a37 Remove extra images 2016-09-09 11:19:44 +01:00
Robert Roskam
c72083db27 Added in reporting data and documentation for loadtesting (#342)
* Starting reporting write up.

* Added in charts

* Added in images to report

* Cleaned up comments

* Added in clarifications about the testing

* Added in clarification

* Added date

* Added in subdir with same content

* Added in supervisor configs

* updated the readme

* Update and rename README.rst to README.md

* Update README.md

* Added in version info.

* Changes to root info

* Update README.md

* Update README.md

* Cleaned up presentation
2016-09-09 11:18:51 +01:00
Daniel Quinn
a96c6fe9c3 Added a " to close the line (#339)
You may also want to make use of:

```
.. code:: python
```

instead of just `::`.  Sphinx will then do the colour highlighting for you and may have helped catch this.

Ooh, and also, it wasn't immediately obvious to me here that `include` is imported from `from channels.routing`.  You may want to add that to the code sample.
2016-09-07 12:20:58 +01:00
Robert Roskam
f69bd99c61 Many changes to the test project (#333)
* Added in simple locust file

* Correcting the file name

* Updated to latest version of daphne

* moving settings up

* Moved over channels settings

* Removed channels settings

* Removed settings file

* Moved around files

* Made a file for normal wsgi

* Changed regular wsgi to point to channels settings

* Create __init__.py

* Added in the appropriate import

* Named it right

* Create urls_no_channels.py

* Delete urls_no_channels.py

* Doing this so I don't have to have multiple urls

* Update urls.py

* Update urls.py

* Added in fabric cmd for installing nodejs loadtest

* Added in git dependency

* Added in a symlink for loadtest

* Made run_loadtest command

* Added in argument for time

* Changed to format on string

* Updated arguments

* Fixed typo for argument

* Made some comments and moved around some tasks

* Edits to readme

* Add a lot more documentation

* Adjusted formatting

* Added a comment

* Made formatting cahnges

* Slight language change

* Changed name for testing

* Changed name for testing

* Update asgi.py

* Added in alternate ChannelLayer

* Rename chanells_inmemory.py to chanels_inmemory.py

* Rename chanels_inmemory.py to channels_inmemory.py

* Create asgi_inmemory

* Rename asgi_inmemory to asgi_inmemory.py

* Added in routing

* Switching to instantiated class

* Update channels_inmemory.py

* Update channels_inmemory.py

* Altered the fabric testing tasks

* Update and rename asgi_inmemory.py to asgi_ipc.py

* Update and rename channels_inmemory.py to channels_ipc.py

* Updated to include asgi_ipc

* Updated environment setup task

* Spelling

* Updated channel layer

* Update asgi_ipc.py

* Rename asgi_ipc.py to asgi_for_ipc.py

* Update asgi_for_ipc.py

* Trying something

* Trying something else

* Changed it back

* changed back
2016-09-02 08:09:01 -07:00
Luke Hodkinson
079558d5b5 Too many threads bug in threaded worker. (#334)
* Use a mixin for common test-case code. This way we can have both
a regular channels test-case, and a transaction test-case, too.

* Adding a reference to django-cq.

* Adding the ability to launch a number of workers in threads.
This is to try and help reduce memory consumption.

* Adding a signal for process level worker startups.

* Cleaning up the threaded worker code.

* Use Python 2.7 friendly code.

* Making the runworker command show a little more information
about how many threads are running.

* Moving the worker ready signal into a method in order to support
polymorphic behavior.

* Ugh, I'm an idiot. Was launching the wrong run.

* Adding a call to the workers' `ready` in `runserver`.

* Fixed a bug whereby too many threads were being
used when threaded workers were used.
2016-09-02 08:02:29 -07:00
Luke Hodkinson
0d25860cf2 Run workers in threads. (#322)
* Use a mixin for common test-case code. This way we can have both
a regular channels test-case, and a transaction test-case, too.

* Adding a reference to django-cq.

* Adding the ability to launch a number of workers in threads.
This is to try and help reduce memory consumption.

* Adding a signal for process level worker startups.

* Cleaning up the threaded worker code.

* Use Python 2.7 friendly code.

* Making the runworker command show a little more information
about how many threads are running.

* Moving the worker ready signal into a method in order to support
polymorphic behavior.

* Ugh, I'm an idiot. Was launching the wrong run.

* Adding a call to the workers' `ready` in `runserver`.
2016-08-31 21:26:03 -07:00
Steven Davidson
a23810e0fa Update ASGI draft spec: http.disconnect gains a path key (#326) 2016-08-30 09:09:04 -07:00
Krukov D
0f579608a3 Added django-channels-panel to the list of projects (#325) 2016-08-29 10:37:19 -07:00
Krukov D
b62ea7dd0a Naming consumers that are classmethods (#324) 2016-08-29 10:37:09 -07:00
Sam Bolgert
7de6ff17d6 Fixed #251: Add docs for testing Generic Consumers (#323) 2016-08-27 13:08:31 -07:00
Krukov D
e6236f79e6 Move the groups at class definition (#321) 2016-08-26 12:12:14 -07:00
Frank Pape
c8fdea6460 Add send_and_consume method to HttpClient to match base Client behavior. Change argument ordering in send method to match base client. Fix repeated "live cycle" error in docstrings. (#320) 2016-08-26 12:04:38 -07:00
Tim Watts
39339e66bc Remove invalid test. FileResponse requires a file object. (#311)
* Remove invalid test. FileResponse requires a file object.

* rm unused imports
2016-08-24 17:39:18 -07:00
Peter Schmidt
860da6e241 Testing Docs: Update import from Channel -> Group (#307) 2016-08-24 14:50:38 -07:00
Andrew Godwin
3e2444b9b9 Clarify tasks better 2016-08-23 20:13:20 -07:00
Andrew Godwin
f699d112b0 Fixed #309: Missed a double decode for header coalescing 2016-08-23 20:10:15 -07:00
Andrew Godwin
3cc6f744a6 Add contributing page to docs 2016-08-23 20:06:56 -07:00
Luke Hodkinson
9a7317f583 Add a link to django-cq. (#310)
* Use a mixin for common test-case code. This way we can have both
a regular channels test-case, and a transaction test-case, too.

* Adding a reference to django-cq.
2016-08-23 19:47:29 -07:00
AlexejStukov
fcb2875b53 fixed usage of group_names in *_change_receiver (#306)
* fixed usage of group_names in *_change_receiver

group_names was missing second arg (action)

* fixed group_names to include action

* made group_names a classmethod
2016-08-23 10:13:46 -07:00
Luke Hodkinson
6649afce8e Use a mixin for common test-case code. This way we can have both (#305)
a regular channels test-case, and a transaction test-case, too.
2016-08-20 17:53:54 -07:00
Tyson Clugg
57fa3bed67 Implement the data binding behaviour from Django DDP. (#301)
* Implement the data binding behaviour from Django DDP.

Correct dispatch of create/update/delete according to how group_names change
when compared between pre and post save/delete.

* Fix tests for databinding improvements.
2016-08-16 16:49:18 +10:00
Oskar Hahn
32568dc879 Start only one worker with the nothreading option. (#298)
Reuse the nothreading option of the runserver command to only start one
worker.
2016-08-15 11:18:24 +10:00
Francis Mwangi
fb2e9320c2 fixed typo (#296) 2016-08-14 12:08:00 +10:00
AlexejStukov
0f1ac3d08b Fix member serialization in WebsocketBindingWithMembers (#292)
* Fix member serialization in WebsocketBindingWithMembers

* pep fixes

* allow usage of 'dot'-notation in send_members

* replace dots for dictionary

* single quotes
2016-08-10 21:55:51 -07:00
Andrew Godwin
f682298341 Show daphne server logs in runserver 2016-08-05 22:17:59 -07:00
AlexejStukov
0bc1cee103 Easy application of decorators to Bindings (#281)
* Added get_handler

Added a get_handler method that applies decorators to the consumer-classmethod

* added imports for decorators

* Added get_handler to WebsocketBinding

* Fixed missing import

* channel_session_user defaults to True

* removed user-transfer from http

would only work in a connect-method

* removed unused import
2016-08-05 00:12:59 -07:00
Andrew Godwin
2d97ab2cc7 Releasing version 0.17.2 2016-08-04 16:55:43 -07:00