Exemplo n.º 1
0
 def __init__(self):
     handlers = url_wrapper([(r"/users/", include('views.users.users_urls'))
                             ])
     #定义Tornado 服务器的配置项,如static/template目录的位置,debug级别等
     settings = dict(debug=True,
                     static_path=os.path.join(os.path.dirname(__file__),
                                              "static"),
                     template_path=os.path.join(os.path.dirname(__file__),
                                                "templates"))
     tornado.web.Application.__init__(self, handlers, **settings)
Exemplo n.º 2
0
    def __init__(self):
        handlers = url_wrapper([(r'/users/', include('views.users.users_urls'))
                                ])

        print(handlers)
        settings = dict(debut=True,
                        static_path=os.path.join(os.path.dirname(__file__),
                                                 '/static'),
                        template_path=os.path.join(os.path.dirname(__file__),
                                                   '/template'))
        tornado.web.Application.__init__(self, handlers, **settings)
Exemplo n.º 3
0
 def __init__(self):
     initdb()
     handlers = url_wrapper([
         (r"/users/", include("views.users.users_urls")),
         (r"/upload/", include("views.upload.upload_urls"))
     ])
     settings = dict(
         debug=True,
         static_path=os.path.join(os.path.dirname(__file__), "static"),
         template_path=os.path.join(os.path.dirname(__file__), "template")
     )
     tornado.web.Application.__init__(self, handlers, **settings)
Exemplo n.º 4
0
 def __init__(self):
     # initdb()
     handlers = url_wrapper([
         (r"/json/", include('views.json.json_urls')),
         (r"/web/", include('views.web.web_urls')),
         (r"/wx/", include('views.wx.wx_urls')),
     ])
     # 定义tornado服务器的配置项,如static/templates目录位置,debug级别等
     settings = dict(debug=True,
                     static_path=os.path.join(os.path.dirname(__file__),
                                              "static"),
                     template_path=os.path.join(os.path.dirname(__file__),
                                                "templates"))
     tornado.web.Application.__init__(self, handlers, **settings)
Exemplo n.º 5
0
 def __init__(self):
     initdb(),
     handles = url_wrapper([(r'/users/', include('views.users.users_urls'))
                            ])
     settings = dict(debug=True,
                     static_path=os.path.join(os.path.dirname(__file__),
                                              "static"),
                     template_path=os.path.join(os.path.dirname(__file__),
                                                "templates"))
     tornado.web.Application.__init__(self, handles, **settings)
     self.db = scoped_session(
         sessionmaker(bind=engine,
                      autocommit=False,
                      autoflush=True,
                      expire_on_commit=False))
Exemplo n.º 6
0
 def __init__(self):
     handlers = url_wrapper([
         (r"/users/", include('views.app.users.users_urls')),
         (r"/goods/", include('views.admin.goods.goods_urls'))
     ])
     # 定义 Tornado 服务器的配置项,如 static/templates 目录位置、debug 级别等
     settings = dict(debug=True,
                     static_path=os.path.join(os.path.dirname(__file__),
                                              "static"),
                     template_path=os.path.join(os.path.dirname(__file__),
                                                "templates"))
     tornado.web.Application.__init__(self, handlers, **settings)
     self.db = scoped_session(
         sessionmaker(bind=engine,
                      autocommit=False,
                      autoflush=True,
                      expire_on_commit=False))
Exemplo n.º 7
0
Arquivo: main.py Projeto: awsay/BMS
 def __init__(self):
     # 路由选择
     handles = url_wrapper([
         (r"/users/", include('views.users.users_urls')),
         (r"/books/", include('views.books.books_urls')),
         (r"/records/", include('views.records.records_urls')),
         (r"/upload/", include('views.uploads.uploads_urls'))
     ])
     # 定义 Tornado 服务器的配置项,如static/templates目录位置,debug级别等
     settings = dict(
         debug=True,
         static_path=os.path.join(os.path.dirname(__file__), "static"),
         template_path=os.path.join(os.path.dirname(__file__), "templates"),
         cookie_secret=
         '61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo='  # 用于cookie加密的salt
     )
     tornado.web.Application.__init__(self, handles, **settings)
Exemplo n.º 8
0
    def __init__(self):
        initDB()
        handler = url_wrapper([
            (r"/users/", include("views.users.user_urls")),
            (r"/", include("view.homepage.homepage_urls"))
        ])
        settings = dict(
            debug=True,
            static_path=os.path.join(os.path.dirname(__file__), "static"),
            template_path=os.path.join(os.path.dirname(__file__), "templates")

        )
        tornado.web.Application.__init__(self,handler, **settings)
        # scoped session is used to ensure thread safety
        self.db = scoped_session(
            sessionmaker(
                bind=engine, autocommit=False, autoflush=True,
                expire_on_commit=False
            )
        )
Exemplo n.º 9
0
    def __init__(self):

        initdb()
        # http://127.0.0.1:8998/users/login
        # http://127.0.0.1:8998/login
        handlers = url_wrapper([(r'/users/', include('views.urls.users_urls')),
                                (r'/upload/',
                                 include('views.urls.upload_urls')),
                                (r'/', IndexHandle)])

        settings = dict(debug=True,
                        static_path=os.path.join(os.path.dirname(__file__),
                                                 "static"),
                        template_path=os.path.join(os.path.dirname(__file__),
                                                   "templates"))

        tornado.web.Application.__init__(self, handlers, **settings)
        self.dbSession = sessionmaker(bind=engine,
                                      autocommit=False,
                                      autoflush=True,
                                      expire_on_commit=False)