- Added librarian as a submodule.
[wolnelektury.git] / wolnelektury / manage.py
1 #!/usr/bin/env python
2 import os.path
3 import sys
4
5 ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
6
7 # Add apps and lib directories to PYTHONPATH
8 sys.path = [
9     os.path.join(ROOT, 'apps'),
10     os.path.join(ROOT, 'lib'),
11     os.path.join(ROOT, 'lib/librarian'),
12 ] + sys.path
13
14 from django.core.management import execute_manager
15
16 try:
17     import settings # Assumed to be in the same directory.
18 except ImportError:
19     import sys
20     sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
21     sys.exit(1)
22
23 if __name__ == "__main__":
24     execute_manager(settings)