zoukankan      html  css  js  c++  java
  • python django get请求传参

    v

    node2:/django/mysite/news#cat views.py
    # -*- coding: utf-8 -*-
    from __future__ import unicode_literals
    
    from django.shortcuts import render
    from django.http import HttpResponse
    
    # Create your views here.
    from django.shortcuts import render,render_to_response,redirect
    from .models import Article
    from django.http import HttpResponse, HttpResponseNotFound
    import datetime
    from django.views.decorators.http import require_http_methods,require_GET
    from django.http import HttpResponseRedirect
    from django.shortcuts import render
    import os
    from django import forms
    def login(request):
        if request.method == "GET":
            print request
            print request.GET
            print '--------------'
            print request.GET['aa']
            print '--------------'
            response = "You're looking at the second  results of question " 
            return HttpResponse(response )
    
    
    <WSGIRequest: GET '/login/?aa=bb'>
    <QueryDict: {u'aa': [u'bb']}>
    --------------
    bb
    --------------
    [27/Nov/2017 16:32:26] "GET /login/?aa=bb HTTP/1.1" 200 50
    
    
    http://192.168.137.3:9000/login/?aa=bb

  • 相关阅读:
    算法技巧之打表
    Python_爬虫_爬取网络图片信息01
    python_爬虫_爬取京东商品信息
    Python——turtle库学习
    Python学习笔记——函数
    131219流水账
    121219流水账
    081219~111219流水账
    071219流水账
    061219流水账
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349405.html
Copyright © 2011-2022 走看看