Hi folks!

I've trying to use sharing db via technique proposed by Dustin at
http://dfcode.com/
(available at
http://webcache.googleusercontent.com/search?q=cache:ukYEYwoaJtYJ:dfcode.com/blog/2011/5/sharing-django-users-and-sessions-across-projects/+sharing+users+django&cd=1&hl=ru&ct=clnk&gl=ru&client=opera)

--------------------------------
it works untill I've trying to exclude /admin from routing via the
following code:
import threading


# Object to hold request data
request_cfg = threading.local()


class RouterMiddleware(object):
    """
    Sets a flag if we are accessing Django admin to prevent database
rerouting
    for the auth model.  Removes the flag once the request has been
processed.
    """

    def process_view(self, request, view_func, args, kwargs):
        if request.path.startswith('/admin'):
            request_cfg.admin = True

    def process_response(self, request, response):
        if hasattr(request_cfg, 'admin'):
            del request_cfg.admin
--------------------------------------------------
Accessing site root get an error:
TypeError at /

argument of type 'NoneType' is not iterable
Exception Location:     /home/alexey/sites/django/http/utils.py in
fix_location_header, line 19:
        if 'Location' in response and request.get_host():
            response['Location'] =
request.build_absolute_uri(response['Location'])
        return response

-------------------------------------------------
Any help much appreciated.
PS.Maybe smth wrong in RouterMiddleware since it does not return a
response?



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to