Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 47 lines (36 sloc) 1.251 kb
0141760 Les Orchard Initial Pinax project start
authored
1 #!/usr/bin/env python
a156258 Les Orchard General tweaks to prepare for Mozilla staging; creating vendor repo; sep...
authored
2 import os
3 import site
0141760 Les Orchard Initial Pinax project start
authored
4 import sys
5
6
a156258 Les Orchard General tweaks to prepare for Mozilla staging; creating vendor repo; sep...
authored
7 ROOT = os.path.dirname(os.path.abspath(__file__))
8
9 path = lambda *a: os.path.join(ROOT, *a)
10
11 prev_sys_path = list(sys.path)
0141760 Les Orchard Initial Pinax project start
authored
12
a156258 Les Orchard General tweaks to prepare for Mozilla staging; creating vendor repo; sep...
authored
13 site.addsitedir(path('apps'))
14 site.addsitedir(path('lib'))
15 site.addsitedir(path('vendor'))
16
17 # Move the new items to the front of sys.path. (via virtualenv)
18 new_sys_path = []
19 for item in list(sys.path):
20 if item not in prev_sys_path:
21 new_sys_path.append(item)
22 sys.path.remove(item)
23 sys.path[:0] = new_sys_path
24
25 # No third-party imports until we've added all our sitedirs!
26 from django.core.management import execute_manager, setup_environ
0141760 Les Orchard Initial Pinax project start
authored
27
28 try:
a156258 Les Orchard General tweaks to prepare for Mozilla staging; creating vendor repo; sep...
authored
29 import settings_local as settings
0141760 Les Orchard Initial Pinax project start
authored
30 except ImportError:
a156258 Les Orchard General tweaks to prepare for Mozilla staging; creating vendor repo; sep...
authored
31 try:
32 import settings
33 except ImportError:
34 import sys
35 sys.stderr.write(
36 "Error: Tried importing 'settings_local.py' and 'settings.py' "
37 "but neither could be found (or they're throwing an ImportError)."
38 " Please come back and try again later.")
39 raise
0141760 Les Orchard Initial Pinax project start
authored
40
a156258 Les Orchard General tweaks to prepare for Mozilla staging; creating vendor repo; sep...
authored
41 # The first thing execute_manager does is call `setup_environ`. Logging config
42 # needs to access settings, so we'll setup the environ early.
43 setup_environ(settings)
0141760 Les Orchard Initial Pinax project start
authored
44
45 if __name__ == "__main__":
a156258 Les Orchard General tweaks to prepare for Mozilla staging; creating vendor repo; sep...
authored
46 execute_manager(settings)
Something went wrong with that request. Please try again.