Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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()

Ejemplo n.º 4
0
Archivo: urls.py Proyecto: DarioGT/lino
"""

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
Ejemplo n.º 5
0
Archivo: urls.py Proyecto: DarioGT/lino
: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
Ejemplo n.º 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()