How to use the tornado.web.url function in tornado

To help you get started, we’ve selected a few tornado examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AutoOps / MagicStack-Proxy / handlers / server / v1_0 / urls.py View on Github external
# @Link    : http://www.magicstack.cn/
# @Version :

from tornado.web import url
from handlers.server.v1_0.api import SystemActionHandler, SystemHandler, DistrosHandler, \
    EventSingalHandler, FileHandler, ProfileHandler

VERSION = 'v1.0' # API Version

urls = [
    url(r'/system/action$', SystemActionHandler),
    url(r'/system$', SystemHandler),
    url(r'/system/(?P.*)$', SystemHandler),
    url(r'/distro?$', DistrosHandler),
    url(r'/distro/(?P.*)$', DistrosHandler),
    url(r'/event/(?P.*)$', EventSingalHandler),
    url(r'/profile/?$', ProfileHandler),
    url(r'/upload/?$', FileHandler),
    url(r'/download/?$', FileHandler)
]
github OpenMDAO / OpenMDAO-Framework / contrib / GUI / openmdao.gui / src / openmdao / gui / handlers_workspace.py View on Github external
handlers = [
    web.url(r'/workspace/?',                                                WorkspaceHandler, name='workspace'),
    web.url(r'/workspace/base/?',                                           ReqHandler),

    web.url(r'/workspace/command',                                          CommandHandler),

    web.url(r'/workspace/files/?',                                          FilesHandler),
    web.url(r'/workspace/file/(.*)',                                        FileHandler),

    web.url(r'/workspace/objects/?',                                        ObjectsHandler),
    web.url(r'/workspace/object/(?P[^\/]+)/?(?P[^\/]+)?',   ObjectHandler),

    web.url(r'/workspace/project',                                          ProjectHandler),

    web.url(r'/workspace/stream/(.*)',                                      StreamHandler),

    web.url(r'/workspace/subscription/(.*)',                                SubscriptionHandler),

    web.url(r'/workspace/types',                                            TypesHandler),
    web.url(r'/workspace/type/(?P[^\/]+)/(?P[^\/]+)',       TypeHandler),

    web.url(r'/workspace/variable/(.*)',                                    VariableHandler),

    # tools
    web.url(r'/workspace/tools/addons/?',       AddOnsHandler),
    web.url(r'/workspace/tools/editor/?',       EditorHandler),
    web.url(r'/workspace/tools/geometry',       GeometryHandler),
    web.url(r'/workspace/tools/images',         ImagesHandler),
    web.url(r'/workspace/tools/upload/?',       UploadHandler),
]
github luoyun / LuoYunCloud / lyweb / app / site / urls.py View on Github external
url( r'/admin/site/article/add',
         admin_views.ArticleAdd, name="admin:site:article:add" ),

    url( r'/admin/site/article/([0-9]+)/edit',
         admin_views.ArticleEdit, name="admin:site:article:edit" ),

    url( r'/admin/site/article/delete',
         admin_views.ajaxArticleDelete, name="admin:site:article:ajax_delete" ),

    # site config
    url( r'/admin/site/config', admin_views.ConfigIndex, name="admin:site:config" ),
    url( r'/admin/site/config/edit', admin_views.ConfigEdit, name="admin:site:config:edit" ),
    url( r'/admin/site/config/delete', admin_views.ConfigDelete, name="admin:site:config:delete" ),

    # site locale config
    url( r'/admin/site/localeconfig', admin_views.LocaleConfigIndex,
         name="admin:site:localeconfig" ),

    url( r'/admin/site/localeconfig/edit',
         admin_views.LocaleConfigEdit,
         name="admin:site:localeconfig:edit" ),

    url( r'/admin/site/localeconfig/([0-9]+)/delete',
         admin_views.LocaleConfigDelete,
         name="admin:site:localeconfig:delete" ),

    # site job
    url( r'/admin/site/job', admin_views.SiteJobIndex,
         name="admin:site:job" ),
    url( r'/admin/site/job/view', admin_views.SiteJobView,
         name="admin:site:job:view" ),
github luoyun / LuoYunCloud / lyweb / app / message / urls.py View on Github external
from tornado.web import url
import app.message.views as msg

handlers = [

    url(r'/message', msg.Index, name='message:index'),
    url(r'/message/inbox', msg.Inbox, name='message:inbox'),
    url(r'/message/outbox', msg.Outbox, name='message:outbox'),
    url(r'/message/([0-9]+)', msg.View, name='message:view'),
    url(r'/message/([0-9]+)/delete', msg.Delete, name='message:delete'),
    url(r'/message/([0-9]+)/reply', msg.Reply,
        name='message:reply'),
    url(r'/message/new', msg.New, name='message:new'),
    url(r'/message/send_notice', msg.SendNotice, name='message:send_notice'),
    url(r'/notice', msg.NoticeHome, name='message:notice'),
    url(r'/notice/([0-9]+)/delete', msg.NoticeDelete, name='message:notice:delete'),
github HDFGroup / h5serv / h5serv / app.py View on Github external
url(r"/datatypes/.*", TypeHandler),
        url(r"/datatypes/", TypeHandler),
        url(r"/datatypes\?.*", TypeCollectionHandler),
        url(r"/datatypes", TypeCollectionHandler),
        url(r"/datasets/.*/value", ValueHandler),
        url(r"/datasets/.*/value\?.*", ValueHandler),
        url(r"/datasets/.*", DatasetHandler),
        url(r"/datasets/", DatasetHandler),
        url(r"/datasets\?.*", DatasetCollectionHandler),
        url(r"/datasets", DatasetCollectionHandler),
        url(r"/groups/.*/links/.*", LinkHandler),
        url(r"/groups/.*/links\?.*", LinkCollectionHandler),
        url(r"/groups/.*/links", LinkCollectionHandler),
        url(r"/groups/", GroupHandler),
        url(r"/groups/.*", GroupHandler),
        url(r"/groups\?.*", GroupCollectionHandler),
        url(r"/groups", GroupCollectionHandler),
        url(r"/info", InfoHandler),
        url(static_url, tornado.web.StaticFileHandler, {'path': static_path}),
        url(r"/(favicon\.ico)", tornado.web.StaticFileHandler, {'path': favicon_path}),
        url(r"/acls/.*", AclHandler),
        url(r"/acls", AclHandler),
        url(r"/", RootHandler),
        url(r".*", DefaultHandler)
    ],  **settings)
    return app
github AutoOps / MagicStack-Proxy / handlers / server / v1_0 / urls.py View on Github external
# @Author  : AutoOps
# @Link    : http://www.magicstack.cn/
# @Version :

from tornado.web import url
from handlers.server.v1_0.api import SystemActionHandler, SystemHandler, DistrosHandler, \
    EventSingalHandler, FileHandler, ProfileHandler

VERSION = 'v1.0' # API Version

urls = [
    url(r'/system/action$', SystemActionHandler),
    url(r'/system$', SystemHandler),
    url(r'/system/(?P.*)$', SystemHandler),
    url(r'/distro?$', DistrosHandler),
    url(r'/distro/(?P.*)$', DistrosHandler),
    url(r'/event/(?P.*)$', EventSingalHandler),
    url(r'/profile/?$', ProfileHandler),
    url(r'/upload/?$', FileHandler),
    url(r'/download/?$', FileHandler)
]
github owtf / owtf / owtf / interface / urls.py View on Github external
def get_file_server_handlers():
    config = ServiceLocator.get_component("config")
    URLS = [
        tornado.web.url(r'/api/workers/?([0-9]+)?/?(abort|pause|resume)?/?$', api_handlers.WorkerHandler, name='workers_api_url'),
        tornado.web.url(r'/api/plugins/progress/?$', api_handlers.ProgressBarHandler, name='poutput_count'),
        tornado.web.url(r'/logs/(.*)', custom_handlers.StaticFileHandler, {'path': config.get_dir_worker_logs()}, name="logs_files_url"),
        tornado.web.url(r'/(.*)', custom_handlers.StaticFileHandler, {'path': config.get_output_dir_target()}, name="output_files_url"),
    ]
    return URLS
github dsblank / activitypub / activitypub / app.py View on Github external
def make_url(path, handler, kwargs=None, name=None):
    #kwargs["options"] = options
    return tornado.web.url(path, handler, kwargs, name)
github Wiredcraft / pipelines / pipelines / api / server.py View on Github external
def make_app(cookie_secret=None, workspace='fixtures/workspace', title='Pipelines', auth=None):
    if cookie_secret is None:
        raise PipelineError('Cookie secret can not be empty')

    if not os.path.isdir(workspace):
        raise PipelinesError('Workspace is not a valid directory: %s' % workspace)

    auth_dict = _get_auth_dict(auth)

    slug_regexp = '[0-9a-zA-Z_\-]+'
    endpoints = [
        url(r"/api/pipelines/", GetPipelinesHandler),
        url(r"/api/pipelines/({slug})/".format(slug=slug_regexp), GetPipelineHandler),
        url(r"/api/pipelines/({slug})/run".format(slug=slug_regexp), RunPipelineHandler),
        url(r"/api/pipelines/({slug})/({slug})/status".format(slug=slug_regexp), GetStatusHandler),
        url(r"/api/pipelines/({slug})/({slug})/log".format(slug=slug_regexp), GetLogsHandler),
        url(r"/api/pipelines/({slug})/triggers".format(slug=slug_regexp), GetTriggersHandler),
        url(r"/api/webhook/({slug})".format(slug=slug_regexp), WebhookHandler),
        url(r"/api/slackbot/({slug})".format(slug=slug_regexp), SlackbotHandler),
        (r"/login", LoginHandler),
        (r'/(.*)', AuthStaticFileHandler, {'path': _get_static_path('app'), "default_filename": "index.html"}),
    ]

    if auth_dict and auth_dict.get('type') == 'gh':
        endpoints.insert(len(endpoints) - 1, (r"/ghauth", GithubOAuth2LoginHandler)),

    return Application(endpoints,
                       title=title,
                       workspace_path=workspace,
                       auth=auth_dict,
                       login_url="/login",
github luoyun / LuoYunCloud / lyweb / app / account / urls.py View on Github external
from tornado.web import url
from . import views
from . import user_views as user
from . import admin_views as admin

handlers = [

    ( r'/login', views.Login ),
    ( r'/logout', views.Logout ),

    ( r'/openid/qq/login', views.QQLogin ),
    url ( r'/openid/user/binding', views.OpenIDUserBinding,
          name="openid:user:binding" ),
    url ( r'/openid/user/new', views.OpenIDUserNew,
          name="openid:user:new" ),

    url( r'/account', views.MyAccount, name='account'),

    # email validate
    url( r'/account/email/validate', views.EmailValidate,
         name='account:email:validate'),

    # password reset
    url( r'/account/resetpass_apply', views.ResetPassApply,
         name='account:resetpass_apply'),

    url( r'/account/resetpass', views.ResetPass,
         name='account:resetpass'),

    url( r'/account/resetmypass', views.ResetMyPass,