web/webconfig.py
changeset 8259 1c5be4a1afd1
parent 8186 341c57b39dc9
child 8349 fdb796435d7b
equal deleted inserted replaced
8258:88a7d2c49d39 8259:1c5be4a1afd1
   319         if baseurl and baseurl[-1] != '/':
   319         if baseurl and baseurl[-1] != '/':
   320             baseurl += '/'
   320             baseurl += '/'
   321         if not (self.repairing or self.creating):
   321         if not (self.repairing or self.creating):
   322             self.global_set_option('base-url', baseurl)
   322             self.global_set_option('base-url', baseurl)
   323         httpsurl = self['https-url']
   323         httpsurl = self['https-url']
   324         if (self.debugmode or self.mode == 'test'):
   324         data_relpath = self.data_relpath()
   325             datadir_path = 'data/'
       
   326         else:
       
   327             datadir_path = 'data/%s/' % self.instance_md5_version()
       
   328         if httpsurl:
   325         if httpsurl:
   329             if httpsurl[-1] != '/':
   326             if httpsurl[-1] != '/':
   330                 httpsurl += '/'
   327                 httpsurl += '/'
   331                 if not self.repairing:
   328                 if not self.repairing:
   332                     self.global_set_option('https-url', httpsurl)
   329                     self.global_set_option('https-url', httpsurl)
   333             self.https_datadir_url = httpsurl + datadir_path
   330             self.https_datadir_url = httpsurl + data_relpath
   334         self.datadir_url = baseurl + datadir_path
   331         self.datadir_url = baseurl + data_relpath
       
   332 
       
   333     def data_relpath(self):
       
   334         if (self.debugmode or self.mode == 'test'):
       
   335             return 'data/'
       
   336         else:
       
   337             return 'data/%s/' % self.instance_md5_version()
   335 
   338 
   336     def _build_ui_properties(self):
   339     def _build_ui_properties(self):
   337         # self.datadir_url[:-1] to remove trailing /
   340         # self.datadir_url[:-1] to remove trailing /
   338         from cubicweb.web.propertysheet import PropertySheet
   341         from cubicweb.web.propertysheet import PropertySheet
   339         cachedir = join(self.appdatahome, 'uicache')
   342         cachedir = join(self.appdatahome, 'uicache')