Closed mrios01 closed 6 years ago
Connect to database before starting to listen. Then use momoko from your request handlers: http://momoko.61924.nl/en/latest/tutorial.html#boilerplate
Hope this helps.
P.S. Use super() instead of specifying anscestor class explicitly.
On 28 Feb 2017 23:50, "plug010" notifications@github.com wrote:
Hi, I am trying to add momoko service to an already running app,but i have no clue of how to. I have run the momoko examples and they work fine, my app has the following structure:
class Application(tornado.web.Application):
def init(self):
handlers = [
(r"/", HomeHandler),
(r"/login", LoginHandler),
(r"/logout", LogoutHandler),
(r"/register", RegisterHandler),
(r"/signup", SignupHandler),
(r"/vprofile/(?P
]
tornado.web.Application.__init__(self, handlers, **config)
def main(): tornado.options.parse_command_line() tornado.locale.load_translations(os.path.join(os.path.dirname(file), "translations")) http_server = tornado.httpserver.HTTPServer(Application(), xheaders=True) http_server.listen(options.port) tornado.ioloop.IOLoop.instance().start()
if name == "main": main()
If someone could help I would be very greateful.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FSX/momoko/issues/151, or mute the thread https://github.com/notifications/unsubscribe-auth/AADjWXs2pKqN-FiLZeUzDejaqAS9UEmjks5rhJaGgaJpZM4MO7jX .
Hi, I am trying to add momoko service to an already running app,but i have no clue of how to. I have run the momoko examples and they work fine, my app has the following structure:
class Application(tornado.web.Application):
def main(): tornado.options.parse_command_line() tornado.locale.load_translations(os.path.join(os.path.dirname(file), "translations")) http_server = tornado.httpserver.HTTPServer(Application(), xheaders=True) http_server.listen(options.port) tornado.ioloop.IOLoop.instance().start()
if name == "main": main()
If someone could help I would be very greateful.