def main(): bottle.run(app=app, server='gae')
app.route('/', ['GET'], views.index) app.route('/access-denied', ['GET'], views.access_denied) app.route('/debug', ['GET'], views.debug) #Session app.route('/auth/registrar', ['GET'], auth_views.registrar) app.route('/auth/registrar', ['POST'], auth_views.do_registrar) app.route('/auth/login', ['GET'], auth_views.login) app.route('/auth/login', ['POST'], auth_views.do_login) app.route('/auth/logout', ['GET'], auth_views.logout) app.route('/auth/listado', ['GET'], auth_views.listado) app.route('/series/listado', ['GET'], series_views.listado) app.route('/series/registrar', ['GET'], series_views.registrar) app.route('/series/registrar', ['POST'], series_views.do_registrar) #app.route('/series/', ['GET'], series_views.) app = bottle.Bottle() routing(app) # launch the App bottle.debug(mode=True) bottle.run(app=app, server="gae")
from framework import bottle from framework.bottle import route, run, template, static_file @route('/GeocodeOakland') def welcome(): output = template('templates/welcome') return output @route('/stlyes/<filename>') def server_static(filename): return static_file(filename, root='/styles') run(host='localhost', port=8080,reloader=True, debug=True)
def main(): run(app=app, server='gae',debug=True)
return bottle.template("contact", dict(email="", subject="",scontent="",notification=notification,s="warning")) else: # To enable mailing, you shoudl go to the application Dashboard --> Administration --> Permissions # Add [email protected] and check your mailbox to verify the account. message = mail.EmailMessage(sender="JournalS Support <*****@*****.**>", #[email protected] is verified by google app engine, so it should be real subject="Your message has been received") message.to = email message.bcc = "*****@*****.**" message.body = """ Dear Journal Seeker: Your message has been received. ------------------------------- """ message.body += scontent + "\n" message.body +=""" ------------------------------- We will contact you as soon as possible. Keep following and keep writing :) JournalS Team """ message.send() notification = "Your message has been sent successfully." return bottle.template("contact", dict(email="", subject="",scontent="",notification=notification,s="success")) #If you want to debug you should use # bottle.run(app=app, server='gae', debug=True) bottle.run(app=app, server='gae')
from framework import bottle import views #urls para enrrutamiento urls = [ ('/', ['GET'], views.index), ('/',['POST'], views.do_index), ] def routing(app): for url in urls: app.route(url[0], url[1], url[2]) app = bottle.Bottle() routing(app) # launch the App bottle.debug(mode=True) bottle.run(app=app, server="gae")
def change_path(cb, path='/', *args, **kwargs): bottle.request.path = path return cb(*args, **kwargs) def contact_filter(filter_dict, contact): if filter_dict is None: return True # Iterate over key-value pairs in filter dictionary, checking whether (1) # the key occurs in the contact dictionary and (2), if so, whether the # filter dictionary value occurs as a substring of the contact dictionary # value for key, value in filter_dict.iteritems(): if value is None or value == "": continue if key not in contact: return False else: if contact[key].lower().find(value.lower()) < 0: return False return True ''' Run test server ''' if __name__ == "__main__": bottle.run(server="gae", app=app, debug=True)