Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Returns a site-like object based on SITE_URL setting than can be used on templates

        def get_controller_site():
    """ 
    Returns a site-like object based on SITE_URL setting than can be used on templates
    """
    # Avoid import problems ...
    from controller import settings as controller_settings
    url = urlparse(controller_settings.SITE_URL)
    return {
        'domain': url.netloc,
        'name': controller_settings.SITE_NAME,
        'scheme': url.scheme
    }
        


src/c/o/confine-controller-0.10.5/controller/apps/notifications/options.py   confine-controller(Download)
from controller.utils import get_controller_site
from controller.utils.plugins import PluginMount
 
 
class Notification(object):
    def get_context(self, obj):
        return {
            'site': get_controller_site(),
            'obj': obj }