zoukankan      html  css  js  c++  java
  • Django 1.8.11 REST风格路由

    # -*- coding: utf-8 -*-
    """
    Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
    Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
    Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
    You may obtain a copy of the License at http://opensource.org/licenses/MIT
    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and limitations under the License.
    """
    
    from django.conf.urls import  include, url
    from . import views
    
    
    
    
    ops_shift_api = [
        url(r'^$', views.GetOps, name='get_ops'),  # code 集合操作
        # url(r'^(?P<pk>d*)/$', detail_code_view, name='detail_code'),  # 访问某个特定对象
        # url(r'^run/$', run_code_view, name='run_code'),  # 运行代码
        # url(r'^run/(?P<pk>d*)/$', run_code_view, name='run_specific_code')  # 运行特定代码
    ]
    
    # API 的 v1 版本
    api_v1 = [url('^ops_shift/', include(ops_shift_api))]
    
    # API 的版本控制入口 URL
    api_versions = [url(r'^v1/', include(api_v1))]
    
    # API 访问 URL
    urlpatterns = [url(r'^api/', include(api_versions))]
    

      

  • 相关阅读:
    MVC3分页传2参
    C# 二进制存储图片到mssql(一)
    著名黑客组织[转]
    浅看C# md5加密
    google搜索技巧
    字符串编码转换 GBK utf8
    objectivec 中随机数的用法 (3种:arc4random() 、random()、CCRANDOM_0_1() )
    NSPredicate的用法
    Java关键字final、static使用总结()
    CGAffineTransform相关函数
  • 原文地址:https://www.cnblogs.com/randomlee/p/10750183.html
Copyright © 2011-2022 走看看