django 포획 URL의 값

985 단어 Django1.8 문서
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[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'),)

[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

좋은 웹페이지 즐겨찾기