Beispiel #1
0
 def ready(self):
     # raise Exception("20150820")
     # print "20151010 LinoConfig.ready() gonna call Site.startup"
     try:
         site_startup()
     except Exception as e:
         print(e)
         raise
Beispiel #2
0
 def ready(self):
     # raise Exception("20150820")
     # print "20151010 LinoConfig.ready() gonna call Site.startup"
     try:
         site_startup()
     except Exception as e:
         print e
         raise
Beispiel #3
0
another time.

Note that `loading.cache.postponed` contains all postponed imports
even if they succeeded at the second attempt.

"""

# cannot use logging here because it causes duplicate logger setup
# in certain situations.
# import logging
# logger = logging.getLogger(__name__)

# import sys

from lino import AFTER17, site_startup

if not AFTER17:

    from django.db.models import loading

    if len(loading.cache.postponed) > 0:
        # i.e. if this is the first time
        if 'lino' not in loading.cache.postponed:
            msg = "Waiting for postponed apps (%s) to import" % \
                  loading.cache.postponed
            # logging.info("20140227 " + msg)
            raise ImportError(msg)

    site_startup()

Beispiel #4
0
"""

from django.conf import settings
from django.conf.urls import url, include
from django.conf.urls.static import static
from lino.core.signals import database_ready
from lino.core.utils import is_devserver

import lino

lino.startup()
# we must explicitly call django.setup() because when running under
# mod_wsgi this is not done automatically as with runserver (or at
# least it seems so)
lino.site_startup()

site = settings.SITE
urlpatterns = []

database_ready.send(site)

if site.site_prefix:
    prefix = site.site_prefix[1:]
else:
    prefix = ""
rx = "^" + prefix

for p in site.installed_plugins:
    pat = p.get_patterns()
    prx = rx
Beispiel #5
0
:setting:`ROOT_URLCONF` is set to :mod:`lino.core.urls`.

"""

from django.conf import settings
from django.conf.urls import url, include
from django.conf.urls.static import static
from lino.core.signals import database_ready
from lino.core.utils import is_devserver

import lino
lino.startup()
# we must explicitly call django.setup() because when running under
# mod_wsgi this is not done automatically as with runserver (or at
# least it seems so)
lino.site_startup()

site = settings.SITE
urlpatterns = []

database_ready.send(site)

if site.site_prefix:
    prefix = site.site_prefix[1:]
else:
    prefix = ''
rx = '^' + prefix

for p in site.installed_plugins:
    pat = p.get_patterns()
    prx = rx
Beispiel #6
0
raise an `ImportError` so that it gets itself postponed and imported
another time.

Note that `loading.cache.postponed` contains all postponed imports
even if they succeeded at the second attempt.

"""

# cannot use logging here because it causes duplicate logger setup
# in certain situations.
# import logging
# logger = logging.getLogger(__name__)

# import sys

from lino import AFTER17, site_startup

if not AFTER17:

    from django.db.models import loading

    if len(loading.cache.postponed) > 0:
        # i.e. if this is the first time
        if 'lino' not in loading.cache.postponed:
            msg = "Waiting for postponed apps (%s) to import" % \
                  loading.cache.postponed
            # logging.info("20140227 " + msg)
            raise ImportError(msg)

    site_startup()