Klaus Demo ~jonashaag/klaus / e8c0ae6
allow to specify repositories root yed_ authored 7 years ago Jiri Suchan committed 7 years ago
2 changed file(s) with 9 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
8484 --env KLAUS_REPOS="/path/to/repo1 /path/to/repo2 ..." \
8585 klaus.contrib.wsgi
8686
87 See also `deploymeny section in the wiki <https://github.com/jonashaag/klaus/wiki#deployment>`_.
87 See also `deployment section in the wiki <https://github.com/jonashaag/klaus/wiki#deployment>`_.
8888
8989 .. _wsgiref: http://docs.python.org/library/wsgiref.html
00 import os
11 import time
22 import threading
3 import warnings
4
35 from klaus import make_app
4
56
67 # Shared state between poller and application wrapper
78 class _:
4849 return app
4950
5051
52 if 'KLAUS_REPOS' in os.environ:
53 warnings.warn("use KLAUS_REPOS_ROOT instead of KLAUS_REPOS for the autoreloader apps", DeprecationWarning)
54
5155 if 'KLAUS_HTDIGEST_FILE' in os.environ:
5256 with open(os.environ['KLAUS_HTDIGEST_FILE']) as file:
53 application = make_app(
54 os.environ['KLAUS_REPOS'],
57 application = make_autoreloading_app(
58 os.environ.get('KLAUS_REPOS_ROOT') or os.environ['KLAUS_REPOS'],
5559 os.environ['KLAUS_SITE_NAME'],
5660 os.environ.get('KLAUS_USE_SMARTHTTP'),
5761 file,
5862 )
5963 else:
6064 application = make_autoreloading_app(
61 os.environ['KLAUS_REPOS'],
65 os.environ.get('KLAUS_REPOS_ROOT') or os.environ['KLAUS_REPOS'],
6266 os.environ['KLAUS_SITE_NAME'],
6367 os.environ.get('KLAUS_USE_SMARTHTTP'),
64 None,
6568 )