Not Found "/lobby/" django-channels routing error

2018-04-04 Thread Mike Johnson Jr
*routing.py*

*from channels import include, route*
*from chat import consumers*
*from . import game_consumers*

*channel_routing = [*
* #game routing*
* route('websocket.connect', game_consumers.ws_connect_lobby, 
path=r"^/lobby/$"),*
*route('websocket.receive', game_consumers.ws_receive_lobby, 
path=r"^/lobby/$"),*
*route('websocket.disconnect', game_consumers.ws_disconnect_lobby, 
path=r"^/lobby/$"),*

*app.js*

*Websocket = {*
*lobby_socket: null,*
*setup_ws_lobby : function(){*
* Websocket.lobby_socket = new 
ReconnectingWebSocket(Websocket.ws_scheme + '://' + window.location.host + 
'/lobby/');*
* Websocket.lobby_socket.onmessage = function(message) {*
* //nothing yet*
*};*
* },*
*}*
*Websocket.setup_ws_lobby();*

*The url is `127.0.0.1:8000/game`. `Websocket.setup_ws_lobby()` is executed 
on page load. I don't see what I'm doing wrong. I get the error `Not Found: 
/lobby/` in my `python manage.py runserver` console when I load the page. 
My routes are clearly set and my js setup seems to route to those routes. 
Can anyone help? Thanks in advance.*

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4c8048eb-3603-45fa-b518-49658b8766cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Not Found "/lobby/" django-channels routing error

2018-04-04 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support.
Use the django-users mailing list for that, or IRC #django on freenode, or
a site like Stack Overflow.

On 4 April 2018 at 03:19, Mike Johnson Jr  wrote:

> *routing.py*
>
> *from channels import include, route*
> *from chat import consumers*
> *from . import game_consumers*
>
> *channel_routing = [*
> * #game routing*
> * route('websocket.connect', game_consumers.ws_connect_lobby,
> path=r"^/lobby/$"),*
> *route('websocket.receive', game_consumers.ws_receive_lobby,
> path=r"^/lobby/$"),*
> *route('websocket.disconnect', game_consumers.ws_disconnect_lobby,
> path=r"^/lobby/$"),*
>
> *app.js*
>
> *Websocket = {*
> *lobby_socket: null,*
> *setup_ws_lobby : function(){*
> * Websocket.lobby_socket = new
> ReconnectingWebSocket(Websocket.ws_scheme + '://' + window.location.host +
> '/lobby/');*
> * Websocket.lobby_socket.onmessage = function(message) {*
> * //nothing yet*
> *};*
> * },*
> *}*
> *Websocket.setup_ws_lobby();*
>
> *The url is `127.0.0.1:8000/game` .
> `Websocket.setup_ws_lobby()` is executed on page load. I don't see what I'm
> doing wrong. I get the error `Not Found: /lobby/` in my `python manage.py
> runserver` console when I load the page. My routes are clearly set and my
> js setup seems to route to those routes. Can anyone help? Thanks in
> advance.*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/4c8048eb-3603-45fa-b518-
> 49658b8766cd%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2BkAJdS9pqs3Qb_GpzUGRYSV6q0oxTTAqf43-Okn-YRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


SafeExceptionReporterFilter should obfuscate all variables in every stack frame below a function decorated with sensitive_variables

2018-04-04 Thread ncvc via Django developers (Contributions to Django itself)
SafeExceptionReporterFilter obfuscates variables in the function decorated 
with sensitive_variables, but it does not obfuscate variables lower in the 
call stack, which could result in sensitive data being leaked in exception 
reports.

For instance:

@sensitive_variables('sensitive')
def decorated_function():
sensitive = 'something sensitive'
undecorated_function(sensitive)

def undecorated_function(var):
raise Exception()


In this code, the "sensitive" variable will be obfuscated in 
the decorated_function stack frame, but "var" in the undecorated_function 
stack frame will not, resulting in the sensitive data being leaked in the 
report. If we wrote undecorated_function, then we can just decorate the 
function ourselves, but if it's from a third-party package, we are unable 
to decorate it.

The solution here is to obfuscate _all_ variables in all stack frames below 
a function decorated with sensitive_variables, since these functions can do 
arbitrary things with the sensitive data. I've written a custom 
SafeExceptionReporterFilter that does this for the company I work for, and 
I think it would be a good behavior to adopt in core Django.

Any thoughts or concerns with this approach?

-- 


This message, including any attachments, is a PRIVATE communication, 
which may contain confidential, legally privileged, and/or proprietary 
information.  If you are not the intended recipient, you are hereby 
notified that any dissemination, disclosure, copying, distribution or use 
of the information contained in or attached to this message is strictly 
prohibited.  Please notify the sender of the delivery error by replying to 
this message, and then permanently delete it from your system.  Unless 
explicitly stated to the contrary, nothing contained in this message shall 
constitute an offer to buy or sell, or a solicitation of an offer to buy or 
sell, any security, property interest or other asset, nor shall it 
constitute a binding obligation of any kind, an official confirmation of 
any transaction or an official statement of Cadre.  


Cadre may monitor, 
review and retain email communications traveling through its networks or 
systems, AND CADRE IS NOT OBLIGATED TO RESTRICT THE USE OR DISCLOSURE OF 
ANY INFORMATION SENT TO IT BY YOU VIA E-MAIL COMMUNICATION. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7376ab0c-530c-42d8-9cfb-6c829af21098%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.