def get_app_settings(): app_settings = [] # load core properties first app_settings.append(get_app_settings_from_dir(os.path.dirname(__file__))) # load root app properties app_settings.append(get_app_settings_from_dir(get_root_dir())) # load sub app properties app_dirs = get_app_dirs() for app_dir in app_dirs: app_settings.append(get_app_settings_from_dir(app_dir)) return app_settings
@author: Shao Guojian ''' import os from core import Application, make_app_wrappers, static_file, redirect from core.settings import settings from core import request from apps import get_app_names, get_app_dirs_dict, get_root_dir #from common.auth import no_auth, get_token_from_request app = Application() get, post, default_error = make_app_wrappers(app, ['get', 'post', 'default_error']) app_dir_dict = get_app_dirs_dict() root_dir = get_root_dir() app_names = get_app_names() # useless in production mode, because nginx will override these rules if settings.ENV_MODE == 'development': print "development mode start" @get('/static/<filename:path>') def serve_static(filename): return static_file(filename, root=os.path.join(root_dir, 'static')) @get('/') @get('/index') @get('/index.html') def serve_index(): #token = get_token_from_request(request)
page api @author: Shao Guojian ''' import os from core import Application, make_app_wrappers, static_file, redirect from core.settings import settings from core import request from apps import get_app_names, get_app_dirs_dict, get_root_dir #from common.auth import no_auth, get_token_from_request app = Application() get, post, default_error = make_app_wrappers(app, ['get', 'post', 'default_error']) app_dir_dict = get_app_dirs_dict() root_dir = get_root_dir() app_names = get_app_names() # useless in production mode, because nginx will override these rules if settings.ENV_MODE == 'development': print "development mode start" @get('/static/<filename:path>') def serve_static(filename): return static_file(filename, root=os.path.join(root_dir, 'static')) @get('/') @get('/index') @get('/index.html') def serve_index(): #token = get_token_from_request(request)