~bloodearnest/canonical-identity-provider/juju-for-dev

« back to all changes in this revision

Viewing changes to django_project/paths.py

  • Committer: root
  • Date: 2015-09-15 16:21:31 UTC
  • Revision ID: root@admin.canonical.com-20150915162131-d4vm8gnlrzvwzgmg
rejig paths

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import os
5
5
 
6
6
PATHS = [
7
 
    os.environ.setdefault('LOCAL_SETTINGS_DIR', '../local_config'),  # config
8
7
    '.',
9
8
    'src',
10
9
    'lib',  # dependencies
11
10
]
12
11
 
 
12
# temporary hack to support both juju and normal dev process. Can be removed
 
13
# if/when juju is *the* dev process
 
14
APPEND_PATHS = [
 
15
    '../local_config',
 
16
]
 
17
 
13
18
 
14
19
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
15
20
PROJECT_ROOT_DIR = os.path.abspath(os.path.join(CURRENT_DIR, os.pardir))
27
32
 
28
33
 
29
34
def setup_paths():
30
 
    sys.path = list(get_paths(PATHS)) + sys.path
 
35
    sys.path = (
 
36
        list(get_paths(PATHS)) + sys.path + list(get_paths(APPEND_PATHS))
 
37
    )
31
38
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
32
39
 
33
40