|
Last change
on this file since 9072 was 9043, checked in by rick, 15 years ago |
|
Make it easy to call.
|
-
Property svn:executable
set to
*
|
|
File size:
924 bytes
|
| Line | |
|---|
| 1 | #!/usr/bin/env python
|
|---|
| 2 | from django.core.management import execute_manager
|
|---|
| 3 | import sys
|
|---|
| 4 | from os.path import dirname, abspath, join
|
|---|
| 5 |
|
|---|
| 6 | # Importing gheat folder to be more easy to test this application. In a real
|
|---|
| 7 | # application should be done with python_path
|
|---|
| 8 | sys.path.append(dirname(dirname(dirname(abspath(__file__)))))
|
|---|
| 9 |
|
|---|
| 10 | # Importing also django extenions
|
|---|
| 11 |
|
|---|
| 12 | sys.path.append(join(dirname(dirname(dirname(abspath(__file__)))),'external','django-extensions'))
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | try:
|
|---|
| 16 | import settings # Assumed to be in the same directory.
|
|---|
| 17 | except ImportError:
|
|---|
| 18 | import sys
|
|---|
| 19 | 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__)
|
|---|
| 20 | sys.exit(1)
|
|---|
| 21 |
|
|---|
| 22 | if __name__ == "__main__":
|
|---|
| 23 | execute_manager(settings)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.