zoukankan      html  css  js  c++  java
  • django捕获url中的值

    1.
    node2:/django/mysite/news#cat ../mysite/urls.py
    """mysite URL Configuration
    
    from django.conf.urls import include,url
    from django.contrib import admin
    from blog import views as view
    from news import views as newview
    urlpatterns =( 
    url(r'^admin/', admin.site.urls),
    url(r'^blog/$',view.archive),
    url(r'^news/',include("news.urls")),
    url(r'^delEquipment/',include("news.urls")),
    url(r'^modifyBtn/ip/(?P<modifyip>[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})/$',newview.modifyBtn),
    
    2.
    def modifyBtn(req,modifyip):
       print modifyip
       return render_to_response('cmdb/modifyBtn.html')
    
    3.
    /api/search_ip/
    192.168.32.101
    (('192.168.32.101', 'dr-mysql', 'env-backup'),)
    <type 'tuple'>
    [25/Dec/2017 12:46:42] "POST /api/search_ip/ HTTP/1.1" 200 46
    [25/Dec/2017 12:46:44] "GET /modifyBtn/ip/192.168.32.101 HTTP/1.1" 301 0
    192.168.32.101

  • 相关阅读:
    在CMD下用java命令出现“找不到或无法加载主类”问题
    去除后台ckeditor的style="...."的样式
    php图片上传
    html图片预览
    论文阅读
    论文阅读
    论文阅读
    论文阅读
    论文阅读
    论文阅读
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349347.html
Copyright © 2011-2022 走看看