| author | cavaliet |
| Tue, 17 Jun 2014 10:25:33 +0200 | |
| changeset 271 | 8f77cf71ab02 |
| parent 114 | web/hdalab/manage.py@c59383cc9940 |
| permissions | -rw-r--r-- |
|
114
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/env python |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
# -*- coding: utf-8 -*- |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
from django.core.management import execute_manager |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
import imp |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
try: |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
imp.find_module('settings') # Assumed to be in the same directory. |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
except ImportError: |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
import sys |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
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" % __file__) |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
sys.exit(1) |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
|
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
import settings |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
|
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
if __name__ == "__main__": |
|
c59383cc9940
migrate categories extraction to hdalab
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
execute_manager(settings) |