#29005: django object builder
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  sergeyglazyrindev                  |
                   Type:  New        |         Status:  new
  feature                            |
              Component:  Core       |        Version:  master
  (Other)                            |
               Severity:  Normal     |       Keywords:  builder 3party
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Hello guys!

 I faced a situation where I need to patch django.contrib,auth.get_user
 function because the "openstack auth backend" should be aware of django
 request.
 Let me describe the situation.

 We use django-websocket-redis python package for websocket stuff. We do
 subscribe to user's channels, so, uwsgi_websocket process should be aware
 of currently signed in user.

 For example, here, django websocket redis requires a recognized user in
 request object
 https://github.com/jrief/django-websocket-
 redis/blob/master/ws4redis/redis_store.py#L22

 BUT, the backend we use in our project requires "request object" inside to
 recognize if user signed in.

 https://github.com/openstack/horizon/blob/master/openstack_auth/backend.py#L78

 And as it suggests, it requires some monkey-patching

   This required monkey-patching the ``contrib.auth`` middleware
   to make the ``request`` object available to the auth backend class.

 Instead I propose to add a simple way to do monkey patching directly in
 django

 For such purpose I added simple changes based on "Builder" design pattern,
 so we may build Django object in iterative way and avoid monkey patches at
 all in different python packages.

 https://github.com/django/django/compare/master...sergeyglazyrindev:master

 Such change will simplify django object adaptation in another python
 packages.

 What do you think ?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29005>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/060.09255e0c51569b340a7805e67a34b2e5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to