2014-10-01 01:15:59 +08:00
|
|
|
from .shortcuts import get_current_site
|
2013-11-19 04:16:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
class CurrentSiteMiddleware(object):
|
|
|
|
"""
|
|
|
|
Middleware that sets `site` attribute to request object.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def process_request(self, request):
|
2014-10-01 01:15:59 +08:00
|
|
|
request.site = get_current_site(request)
|