def auth_pages(self,perms,pid) : args = {} args['client_id'] = config['facebook.appid'] args['redirect_uri'] = h.url() args['enable_profile_selector'] = 1 # args['profile_selector_ids'] = [pid] log.debug( 'MigratingUser.auth_pages %s' % (args,) ) auth_url = AUTH_BASE_URL + urllib.urlencode(args) return h.redirect( auth_url,qualified=False )
def redirect_to_auth(user) : log.debug('redirect_to_auth') args = {} args['client_id'] = config['facebook.appid'] args['redirect_uri'] = h.url() if perms : args['scope'] = ','.join(perms) auth_url = AUTH_BASE_URL + urllib.urlencode(args) log.debug( auth_url ) return h.redirect( auth_url,qualified=False )
from helpers import url url('/api/', 'views.index', methods=["GET", ]) # main, status page url('/api/level/', 'views.get_levels_list', methods=["GET", ]) # returns levels list url('/api/entry/', 'views.add_logentry', methods=["POST", ]) # creating new log entry in DB url('/api/list/', 'views.get_logentry_list', methods=["GET", "POST"]) # get logentry list url('/api/owners/', 'views.get_owners', methods=["GET", ]) # get logentry list url('/api/count/', 'views.count_logentries', methods=["GET", "POST"]) # count logentries
def validate_website(self, field): data = field.data if data and not url(data): raise ValidationError('不符合 url 规范')
from helpers import url url('/api/', 'views.index', methods=[ "GET", ]) # main, status page url('/api/level/', 'views.get_levels_list', methods=[ "GET", ]) # returns levels list url('/api/entry/', 'views.add_logentry', methods=[ "POST", ]) # creating new log entry in DB url('/api/list/', 'views.get_logentry_list', methods=["GET", "POST"]) # get logentry list url('/api/owners/', 'views.get_owners', methods=[ "GET", ]) # get logentry list url('/api/count/', 'views.count_logentries', methods=["GET", "POST"]) # count logentries