comparison src/server/constants.py @ 917:86563d6c83b0

server: Libervia pages: - introduce new LiberviaPage which are easy to create web pages tailored for SàT architecture. They are expected to be the cornerstone of the future of Libervia. - webpages paths reflected by files paths in src/pages directory (directory should be changeable in the future) - if a pages subdirectory as a page_meta.py file, it is a webpage, same for sub-subdirectories and so on - page_meta.py variable are used to instanciate the resource. Check __init__ docstring for details - access is set with a page_meta.py variable (only public for now), and subdirectories access are restricted by parent directory ones. - callables in page_meta.py get 2 arguments: the LiberviaPage resource instance, and the request - callables there can use Deferred (or not) - LiberviaPage has a couple of helper method to e.g. parse URL or return an error
author Goffi <goffi@goffi.org>
date Sun, 05 Mar 2017 23:56:31 +0100
parents 5cefc6ab302f
children 16d1084d1371
comparison
equal deleted inserted replaced
916:e9bb7257d051 917:86563d6c83b0
30 HTML_DIR = "html/" 30 HTML_DIR = "html/"
31 THEMES_DIR = "themes/" 31 THEMES_DIR = "themes/"
32 THEMES_URL = "themes" 32 THEMES_URL = "themes"
33 MEDIA_DIR = "media/" 33 MEDIA_DIR = "media/"
34 CARDS_DIR = "games/cards/tarot" 34 CARDS_DIR = "games/cards/tarot"
35 PAGES_DIR = u"pages"
35 36
36 ERRNUM_BRIDGE_ERRBACK = 0 # FIXME 37 ERRNUM_BRIDGE_ERRBACK = 0 # FIXME
37 ERRNUM_LIBERVIA = 0 # FIXME 38 ERRNUM_LIBERVIA = 0 # FIXME
38 39
39 # Security limit for Libervia (get/set params) 40 # Security limit for Libervia (get/set params)
46 ALLOWED_ENTITY_DATA = {'avatar', 'nick'} 47 ALLOWED_ENTITY_DATA = {'avatar', 'nick'}
47 48
48 STATIC_RSM_MAX_LIMIT = 100 49 STATIC_RSM_MAX_LIMIT = 100
49 STATIC_RSM_MAX_DEFAULT = 10 50 STATIC_RSM_MAX_DEFAULT = 10
50 STATIC_RSM_MAX_COMMENTS_DEFAULT = 10 51 STATIC_RSM_MAX_COMMENTS_DEFAULT = 10
52
53 ## Libervia pages ##
54 PAGES_META_FILE = u"page_meta.py"
55 PAGES_ACCESS_PUBLIC = u"public"
56 PAGES_ACCESS_PROFILE = u"profile" # a session with an existing profile must be started
57 PAGES_ACCESS_ADMIN = u"admin" # only profiles set in admins_list can access the page
58 PAGES_ACCESS_ALL = (PAGES_ACCESS_PUBLIC, PAGES_ACCESS_PROFILE, PAGES_ACCESS_ADMIN)