Did I find the right examples for you? yes no

All Samples(48)  |  Call(33)  |  Derive(0)  |  Import(15)
returns True if app is installed 

        def is_installed(app):
    """ returns True if app is installed """
    from django.conf import settings
    return app in settings.INSTALLED_APPS
        


src/c/o/confine-controller-0.10.5/controller/menu.py   confine-controller(Download)
from admin_tools.menu import items, Menu
from django.core.urlresolvers import reverse
 
from controller.utils.apps import is_installed
 
            items.Bookmarks(),]
 
        if is_installed('nodes') and user.has_module_perms('nodes'):
            node_items = [
                items.MenuItem('Nodes',
                    reverse('admin:state_report')),
            ]
            if is_installed('gis'):
                node_items.insert(
                    1,
                    children=node_items))
 
        if is_installed('slices') and user.has_module_perms('slices'):
            self.children.append(items.MenuItem('Slices',
                reverse('admin:slices_slice_changelist'),
                ]))
 
        if is_installed('mgmtnetworks.tinc'):
            if user.is_superuser:
                self.children.append(items.MenuItem('Tinc',

src/c/o/confine-controller-0.10.5/controller/urls.py   confine-controller(Download)
from django.conf.urls import patterns, include, url
 
from controller.utils.apps import is_installed
 
 
 
 
if is_installed('registration'):
    urlpatterns += patterns('',
        url(r'^accounts/', include('users.registration.urls')),)
 
if is_installed('captcha'):
    )
 
if is_installed('api'):
    from api import api
    api.autodiscover()
 
 
if is_installed('gis'):
    urlpatterns += patterns('',
        url(r'^gis/', include('gis.urls')),)

src/c/o/confine-controller-0.10.5/controller/management/commands/postupgradecontroller.py   confine-controller(Download)
from django.core.management.base import BaseCommand
 
from controller.utils.apps import is_installed
from controller.utils.system import run, check_root
 
            if version < 835:
                # prevent schema migrations from failing
                if is_installed('firmware'):
                    from firmware.models import Build
                    Build.objects.filter(base_image=None).update(base_image='')
            if version <= 902:
                if is_installed('maintenance'):
            run("python manage.py syncdb --noinput")
            run("python manage.py migrate --noinput")
            if is_installed('firmware'):
                run("python manage.py syncfirmwareplugins")
            if is_installed('notifications'):

src/c/o/confine-controller-0.10.5/controller/apps/communitynetworks/models.py   confine-controller(Download)
 
from controller.models.fields import URIField
from controller.utils.apps import is_installed
from nodes.models import Node, Server
 
# This must be at the begining in order to avoid wired import problems
related_models = [Node, Server]
if is_installed('mgmtnetworks.tinc'):
    from mgmtnetworks.tinc.models import Gateway
    related_models.append(Gateway)
            node = self.content_object
            if field == 'gis':
                if not is_installed('gis'):
                    raise ImproperlyConfigured("'%s' field cannot be cached from CNDB (gis app is not installed)." % field)
                from gis.models import NodeGeolocation

src/c/o/confine-controller-0.10.5/controller/apps/users/registration/urls.py   confine-controller(Download)
from django.conf.urls import patterns, url
from django.views.generic.base import TemplateView
 
from controller.utils.apps import is_installed
from registration.backends.default.urls import urlpatterns as registration_urlpatterns
 
from . import BackendFactory
 
if is_installed('captcha'):

src/c/o/confine-controller-0.10.5/controller/apps/pings/models.py   confine-controller(Download)
from django.db import models
 
from controller.utils.apps import is_installed
from controller.utils.time import heartbeat_expires
 
for instance in PING_INSTANCES:
    # This has to be before Ping class in order to avoid import problems
    if is_installed(instance.get('app')):
        context = {
            'app': instance.get('app'),

src/c/o/confine-controller-0.10.5/controller/apps/communitynetworks/serializers.py   confine-controller(Download)
 
from api import api
from controller.utils.apps import is_installed
from nodes.models import Server, Node
 
 
 
if is_installed('mgmtnetworks.tinc'):
    from mgmtnetworks.tinc.models import Gateway
    api.aggregate(Gateway, CnHostSerializer, name='cn')

src/c/o/confine-controller-0.10.5/controller/utils/auth.py   confine-controller(Download)
import base64
 
from django.contrib.auth import authenticate, login
 
from controller.utils.apps import is_installed
                            login(request, user)
                            request.user = user
                elif method == "Token" and is_installed('rest_framework'):
                    from rest_framework.authentication import TokenAuthentication
                    from rest_framework.exceptions import AuthenticationFailed

src/c/o/confine-controller-0.10.5/controller/templatetags/utils.py   confine-controller(Download)
 
from controller import get_version
from controller.utils.apps import is_installed
 
 
def app_is_installed(app_name):
    return is_installed(app_name)
 
 
@register.simple_tag(name="version")

src/c/o/confine-controller-0.10.5/controller/apps/pings/tasks.py   confine-controller(Download)
 
from controller.utils import LockFile
from controller.utils.apps import is_installed
from controller.utils.time import group_by_interval, get_sloted_start
 
    # Create periodic tasks
    hour = 2
    if is_installed(instance.get('app')) and settings.get('schedule') > 0:
        name = "pings.%s_ping" % instance.get('app')
        run_every = settings.get('schedule')

  1 | 2  Next