Mercurial > libervia-web
comparison src/server/server.py @ 704:5319110a862c
server_side: static blog uses the default template
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 04 Jun 2015 12:39:27 +0200 |
parents | c2f22ca12e23 |
children | 531eacb82e9f |
comparison
equal
deleted
inserted
replaced
703:1a19ee7d8d8a | 704:5319110a862c |
---|---|
1055 self.port_https_ext = self.port_https | 1055 self.port_https_ext = self.port_https |
1056 if self.data_dir == DATA_DIR_DEFAULT: | 1056 if self.data_dir == DATA_DIR_DEFAULT: |
1057 coerceDataDir(self.data_dir) # this is not done when using the default value | 1057 coerceDataDir(self.data_dir) # this is not done when using the default value |
1058 | 1058 |
1059 self.html_dir = os.path.join(self.data_dir, C.HTML_DIR) | 1059 self.html_dir = os.path.join(self.data_dir, C.HTML_DIR) |
1060 self.server_css_dir = os.path.join(self.data_dir, C.SERVER_CSS_DIR) | 1060 self.themes_dir = os.path.join(self.data_dir, C.THEMES_DIR) |
1061 | 1061 |
1062 self._cleanup = [] | 1062 self._cleanup = [] |
1063 | 1063 |
1064 root = ProtectedFile(self.html_dir) | 1064 root = ProtectedFile(self.html_dir) |
1065 | 1065 |
1105 putChild('json_api', MethodHandler(self)) | 1105 putChild('json_api', MethodHandler(self)) |
1106 putChild('register_api', _register) | 1106 putChild('register_api', _register) |
1107 putChild('upload_radiocol', _upload_radiocol) | 1107 putChild('upload_radiocol', _upload_radiocol) |
1108 putChild('upload_avatar', _upload_avatar) | 1108 putChild('upload_avatar', _upload_avatar) |
1109 putChild('blog', MicroBlog(self)) | 1109 putChild('blog', MicroBlog(self)) |
1110 putChild('css', ProtectedFile(self.server_css_dir)) | 1110 putChild('themes', ProtectedFile(self.themes_dir)) |
1111 putChild(os.path.dirname(C.MEDIA_DIR), ProtectedFile(self.media_dir)) | 1111 putChild(os.path.dirname(C.MEDIA_DIR), ProtectedFile(self.media_dir)) |
1112 putChild(os.path.dirname(C.AVATARS_DIR), ProtectedFile(os.path.join(self.local_dir, C.AVATARS_DIR))) | 1112 putChild(os.path.dirname(C.AVATARS_DIR), ProtectedFile(os.path.join(self.local_dir, C.AVATARS_DIR))) |
1113 putChild('radiocol', ProtectedFile(_upload_radiocol.getTmpDir(), defaultType="audio/ogg")) # We cheat for PoC because we know we are on the same host, so we use directly upload dir | 1113 putChild('radiocol', ProtectedFile(_upload_radiocol.getTmpDir(), defaultType="audio/ogg")) # We cheat for PoC because we know we are on the same host, so we use directly upload dir |
1114 wrapped = EncodingResourceWrapper(root, [server.GzipEncoderFactory()]) | 1114 wrapped = EncodingResourceWrapper(root, [server.GzipEncoderFactory()]) |
1115 self.site = server.Site(wrapped) | 1115 self.site = server.Site(wrapped) |