root/manage.py

Revision fc455432ce5a7b8ca4a26c5157ec19afad5d56b3, 1.6 KB (checked in by Binary <binary@…>, 21 months ago)

graphical captcha refs #13

  • Property mode set to 100755
Line 
1#!/usr/bin/python
2from django.core.management import execute_manager
3import os
4import sys
5
6LIBS = (
7    # tuple for path, where each element is an element of tuple                                                                                                               
8    # libs/django -> ('django',)                                                                                                                                               
9    # libs/foo/bar -> ('foo', 'bar')                                                                                                                                           
10    ('django-staticmedia-0.2.2',),
11    ('django-simple-captcha-0.1.7',),
12    ('twilix',),
13)
14
15
16proj_root = os.path.dirname(os.path.abspath(__file__))
17
18# add third-party libs to sys.path                                                                                                                                             
19for lib in LIBS:
20    libdir = os.path.join(proj_root, 'libs', *lib)
21    if os.path.isdir(libdir) and libdir not in sys.path:
22        sys.path.insert(0, libdir)
23
24try:
25    import settings # Assumed to be in the same directory.
26except ImportError:
27    raise
28    import sys
29    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__)
30    sys.exit(1)
31
32
33if __name__ == "__main__":
34    execute_manager(settings)
Note: See TracBrowser for help on using the browser.