-# change these if you use a different convention
-
-DEVELOPER_ROOT=os.path.expanduser("~/git/myslice-django")
-
-PRODUCTION_ROOT="/usr/share/myslice"
+# compute ROOT from where this file is installed
+# should fit every need including developers
+# but you can redefine ROOT if that's not working for you
+try:
+ # get the directory where this file is
+ ROOT=os.path.dirname(__file__) or '.'
+ # move one step up
+ ROOT=os.path.realpath(ROOT+'/..')
+except:
+ ROOT=None
+ if DEBUG:
+ import traceback
+ traceback.print_exc()
+
+if os.path.isdir(os.path.join(ROOT,"static")):
+ DATAROOT=ROOT
+else:
+ DATAROOT="/usr/share/unfold"
+ if not os.path.isdir(os.path.join(DATAROOT,"static")):
+ DATAROOT=None
+
+if not ROOT: raise Exception,"Cannot find ROOT for myslice"
+if not DATAROOT: raise Exception,"Cannot find DATAROOT for myslice"