Coverage for lino/__init__.py : 80%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: UTF-8 -*- # Copyright 2002-2016 Luc Saffre # License: BSD (see file COPYING for details)
.. autosummary:: :toctree:
core hello api utils mixins projects modlib sphinxcontrib
"""
# above line is equivalent to "execfile(filename)", except that it # works also in Python 3
PYAFTER26 = True else: PYAFTER26 = False
os.environ['DJANGO_SETTINGS_MODULE'] = settings_module from lino.api.shell import settings
raise Exception("Invalid language code %r. " "Use values like 'en' or 'en-us'." % django_code)
else: raise Exception("Unsupported Django version %s" % VERSION)
"""Start up Django and Lino.
Until Django 1.6 this was called automatically (by :mod:`lino.modlib.lino_startup`), but this trick no longer worked after 1.7.
This is called automatically when a process is invoked by a *management command*.
For testable documents you need to call it manually using e.g.:
>>> import lino >>> lino.startup('my.project.settings')
Note that above two lines are recommended over the old-style method (which works only under Django 1.6)::
>>> import os >>> os.environ['DJANGO_SETTINGS_MODULE'] = 'my.project.settings'
""" #print "startup"
#print "startup done"
"""Called from `lino.models` before Django 1.7""" #print "site_startup" settings.SITE.startup() else: except ImportError as e: import traceback #~ traceback.print_exc(e) #~ sys.exit(-1) raise Exception("ImportError during startup:\n" + traceback.format_exc(e))
# deprecated use, only for backwards compat:
|