def get_itoken(self, env):
        if not self.itoken or self.itoken_expires < time() or \
                env.get('HTTP_X_AUTH_NEW_TOKEN', 'false').lower() in \
                TRUE_VALUES:
            self.itoken = '%sitk%s' % (self.reseller_prefix, uuid4().hex)
            memcache_key = '%s/auth/%s' % (self.reseller_prefix, self.itoken)
            self.itoken_expires = time() + self.token_life
            memcache_client = cache_from_env(env)
            if not memcache_client:
                raise Exception(
                    'No memcache set up; required for Swauth middleware')
            memcache_client.set(
                memcache_key,
                (self.itoken_expires,
                 '.auth,.reseller_admin,%s.auth' % self.reseller_prefix),
                time=self.token_life)
        return self.itoken
M2M relations can cross databases if the database share a source
dataset/ETHPy150Open openstack/swauth/swauth/middleware.py/Swauth.get_itoken--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/multiple_database/tests.py/RouterTestCase.test_m2m_cross_database_protection