# -*- 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))]

  

Django 1.8.11 REST风格路由的更多相关文章

  1. python 之django (一) Windows环境下Django 1.6.11开发环境搭建(简易版)

    转自 https://www.cnblogs.com/kkddij/p/4397163.html 需要安装如下部件: python 2.6.6 pip(最新版即可) Django 1.6.11 PyC ...

  2. Django 1.8.11 查询数据库返回JSON格式数据

    Django 1.8.11 查询数据库返回JSON格式数据 和前端交互全部使用JSON,如何将数据库查询结果转换成JSON格式 环境 Win10 Python2.7 Django 1.8.11 返回多 ...

  3. Django框架(三) 复习总结与路由控制

    知识点回顾 MTV模型 model:模型,和数据库相关的 template:模板,存放html文件,模板语法(目的是将变量如何巧妙的嵌入到HTML页面中). views:视图函数 另加urls:url ...

  4. django上课笔记1-目录介绍-路由系统-ORM操作

    一.Django目录介绍 django-admin startproject mysite # 创建名为mysite的项目 cd mysite # 切换到该目录下 python manage.py s ...

  5. Django 的 一些基本操作:视图函数,路由配置

    当安装好Django 通过上篇的随笔创好项目我们就能来耍下了, 但你会在你的项目中发现有一个settings.py 的文件,对的你肯定想到了需要配置,好了话不多说 Settings.py 找到下面的位 ...

  6. Django(一):url路由配置和模板渲染

    urls.py路由用法 url基本概念 url格式 urls.py的作用 url解析过程 include的作用 kwarg的作用 name的作用 URL概念 URL(Uniform Resoure L ...

  7. Django之路——11 Django用户认证组件 auth

    用户认证 auth模块 1 from django.contrib import auth django.contrib.auth中提供了许多方法,这里主要介绍其中的三个: 1.1 .authenti ...

  8. Django基础之二(URL路由)

    URL路由 简介 对于高质量的web应用来说,使用简洁,优雅的URL路由是一个值得尊重的细节,Django可以随心所欲的设计URL,不受框架的约束 为了给一个应用设计URL,你需要一个Python模块 ...

  9. django的静态文件配置和路由控制

    上一篇写到刚建完django项目,此时我登录页面中调用了js文件,执行后发现报错了找不到js这个文件 目录结构如图所示: <!DOCTYPE html> <html lang=&qu ...

随机推荐

  1. iOS [CIContext initWithOptions:]: unrecognized selector sent to instance 模拟器 iOS 8.4

    在模拟器(iPhone 4s,iOS 8.4)中运行应用时, 应用crash在了使用CIContext(options:nil) 这个API的一个纯Swift第三方库. StackOverFlow的解 ...

  2. h5-24-百度地图-地址解析

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  3. Excel 宏练习

    任务描述: 利用 Excel 绘制函数图像 f(x)=x^2/3+0.9*(3.3-x^2)^1/2*sin(a*x),并通过按钮事件来刷新图像. 问题分析: 可以参考类似 Matlab 绘图的方式, ...

  4. 【前端】Html5浏览器缓存 sessionStorage 与 localStorage

    一.sessionStorage: 浏览关闭会话结束就被清除:(不能跨页面) localStorage:永久保存: 二.使用 var storage = window.sessionStorage; ...

  5. 《精通css》笔记

    第2章    选择器,注释 1.要知道常用选择器(id选择器,类选择器,类型选择器,后代选择器,伪类选择器(文档结构之外)) 通用选择器(*{    }) 高级选择器(子选择器,相邻同胞选择器,属性选 ...

  6. 重新部署mysql遇到的问题

    Windows 2008 Server R2 MySql: 5.7 下载Mysql. 配置mysql环境变量 注册mysql服务.(mysqld install) 移除注册,sc delete mys ...

  7. UI常用字体定义和继承的实例,ResearchKitCode

    #import <UIKit/UIKit.h> @interface UIFont (APCAppearance) + (UIFont*) appRegularFontWithSize: ...

  8. SqlServer 2008 创建测试数据

    包含要点: 数据库的循环 . insert select 句式   . 随机数(rand()函数).绝对值(abs()函数) ) ) DECLARE @randomvalue float SET @s ...

  9. ML-学习提纲2

    https://machinelearningmastery.com/a-tour-of-machine-learning-algorithms/ http://blog.csdn.net/u0110 ...

  10. $.noconflict() 有什么用处

    jQuery默认使用"$"操作符,prototype等其他框架也是是使用"$",于是,如果jQuery在其他库之后引入,那么jQuery将获得"$&q ...