search
HomeBackend DevelopmentPython TutorialPython development [Django]: combined search, JSONP, XSS filtering

1. Simple implementation

Associated files:

from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^index.html/$',views.index),
    url(r'^article/(?P<article_type>\d+)-(?P<category>\d+).html/$',views.article)
]

url.py</category></article_type>
nbsp;html>


    <meta>
    <title>Title</title>
    <style>
        .condition a{
            display:inline-block;
            padding: 3px 5px;
            border: 1px solid black;
        }
        .condition a.active{
            background-color: brown;
        }
    </style>


    <h2 id="过滤条件">过滤条件</h2>


    <div>
        {% if kwargs.article_type == 0 %}
            <a>全部</a>
        {% else %}
            <a>全部</a>
        {% endif %}

        {% for row in article_type %}
            {% if row.id == kwargs.article_type %}
                <a>{{ row.caption }}</a>
            {% else %}
                <a>{{ row.caption }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <div>
        {% if kwargs.category == 0 %}
            <a>全部</a>
        {% else %}
            <a>全部</a>
        {% endif %}

        {% for row in category %}
            {% if row.id == kwargs.category %}
                <a>{{ row.caption }}</a>
            {% else %}
                <a>{{ row.caption }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <h2 id="查询结果">查询结果</h2>
    
        {% for row in articles %}         
  • {{ row.id }}-{{ row.title }}------[{{ row.article_type.caption }}]-[{{ row.category.caption }}]
  •     {% endfor %}     
article.html

Database structure:

from django.db import models
 
# Create your models here.
 
class Categoery(models.Model):
    caption = models.CharField(max_length=16)
 
class ArticleType(models.Model):
    caption = models.CharField(max_length=16)
 
class Article(models.Model):
 
    title = models.CharField(max_length=32)
    content = models.CharField(max_length=255)
 
    category = models.ForeignKey(Categoery)
    article_type = models.ForeignKey(ArticleType)

Processing files:

from . import  models
def article(request,*args,**kwargs):
 
    search_dict = {}
    for key,value in kwargs.items():
        kwargs[key] = int(value)        # 把字符类型转化为int类型 方便前端做if a == b  这样的比较
        if value !='0':
            search_dict[key] = value
    articles = models.Article.objects.filter(**search_dict) # 字典为空时表示搜索所有
 
    article_type = models.ArticleType.objects.all()
    category = models.Categoery.objects.all()
 
    return render(request,'article.html',{'articles':articles,
                                          'article_type':article_type,
                                         'category':category ,
                                          'kwargs':kwargs})

Note: It is not necessary to implement this function Difficult, the most important thing is to clarify the ideas inside; first, determine the url access path format http://127.0.0.1:8000/article/0-0.html, the first 0 represents the article_type field, and the second 0 Indicates the category field. If it is zero, it means searching for all information in this field. Confirming this is the first step to success. There is retrieval processing on the processing file; the second key point is to generate a dictionary search_dict for related searches. If If it is 0, it means searching all; the third key point is also a very clever way, passing the parameter kwargs to the front end again, it is a stroke of genius!

2. Another attempt (loading memory tuning)

Since the ArticleType type is fixed data for the blog, it will not be changed later, so you can load the data into the memory to speed up the query

nbsp;html>


    <meta>
    <title>Title</title>
    <style>
        .condition a{
            display:inline-block;
            padding: 3px 5px;
            border: 1px solid black;
        }
        .condition a.active{
            background-color: brown;
        }
    </style>


    <h2 id="过滤条件">过滤条件</h2>

    <div>
        {% if kwargs.article_type_id == 0 %}
            <a>全部</a>
        {% else %}
            <a>全部</a>
        {% endif %}

        {% for row in article_type%}
            {% if row.0 == kwargs.article_type_id %}
                <a>{{ row.1 }}</a>
            {% else %}
                <a>{{ row.1 }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <div>
        {% if kwargs.category_id == 0 %}
            <a>全部</a>
        {% else %}
            <a>全部</a>
        {% endif %}

        {% for row in category %}
            {% if row.id == kwargs.category_id %}
                <a>{{ row.caption }}</a>
            {% else %}
                <a>{{ row.caption }}</a>
            {% endif %}
        {% endfor %}
    </div>

    <h2 id="查询结果">查询结果</h2>
    
        {% for row in articles %}         
  • {{ row.id }}-{{ row.title }}------[{{ row.article_type }}]-[{{ row.category.caption }}]
  •     {% endfor %}     
article.html
from django.shortcuts import render
from django.shortcuts import HttpResponse

# Create your views here.

def index(request):


    return HttpResponse('Ok')


from . import  models
def article(request,*args,**kwargs):

    search_dict = {}
    for key,value in kwargs.items():
        kwargs[key] = int(value)        # 把字符类型转化为int类型 方便前端做if a == b  这样的比较
        if value !='0':
            search_dict[key] = value
    print(kwargs)
    articles = models.Article.objects.filter(**search_dict) # 字典为空时表示搜索所有

    article_type = models.Article.type_choice

    print(article_type)
    category = models.Categoery.objects.all()

    return render(request,'article.html',{'articles':articles,
                                          'article_type':article_type,
                                         'category':category ,
                                          'kwargs':kwargs})

处理文件.py

Database file:

from django.db import models
# Create your models here.
class Categoery(models.Model):
    caption = models.CharField(max_length=16)
 
# class ArticleType(models.Model):
#     caption = models.CharField(max_length=16)
 
class Article(models.Model):
    title = models.CharField(max_length=32)
    content = models.CharField(max_length=255)
 
    category = models.ForeignKey(Categoery)
    # article_type = models.ForeignKey(ArticleType)
    type_choice  = [
        (1,'Python'),
        (2,'Linux'),
        (3,'大数据'),
        (4,'架构'),
    ]
    article_type_id = models.IntegerField(choices=type_choice)

3. Use simple_tag to optimize the code

Associated files:

from django.db import models
# Create your models here.
class Categoery(models.Model):
    caption = models.CharField(max_length=16)

class ArticleType(models.Model):
    caption = models.CharField(max_length=16)

class Article(models.Model):
    title = models.CharField(max_length=32)
    content = models.CharField(max_length=255)

    category = models.ForeignKey(Categoery)
    article_type = models.ForeignKey(ArticleType)
    # type_choice  = [
    #     (1,'Python'),
    #     (2,'Linux'),
    #     (3,'大数据'),
    #     (4,'架构'),
    # ]
    # article_type_id = models.IntegerField(choices=type_choice)

数据库文件.py
from django.shortcuts import render
from django.shortcuts import HttpResponse

# Create your views here.

def index(request):


    return HttpResponse('Ok')


from . import models
def article(request, *args, **kwargs):
    search_dict = {}
    for key, value in kwargs.items():
        kwargs[key] = int(value)  # 把字符类型转化为int类型 方便前端做if a == b  这样的比较
        if value != '0':
            search_dict[key] = value
    articles = models.Article.objects.filter(**search_dict)  # 字典为空时表示搜索所有

    article_type = models.ArticleType.objects.all()

    print(article_type)
    category = models.Categoery.objects.all()


    return render(request, 'article.html', {'articles': articles,
                                            'article_type': article_type,
                                            'category': category,
                                            'kwargs': kwargs})

处理文件.py
{% load filter %}
nbsp;html>


    <meta>
    <title>Title</title>
    <style>
        .condition a{
            display:inline-block;
            padding: 3px 5px;
            border: 1px solid black;
        }
        .condition a.active{
            background-color: brown;
        }
    </style>


    <h2 id="过滤条件">过滤条件</h2>
    <div>
        {% filter_all  kwargs 'article_type'%}

        {% filter_single article_type kwargs 'article_type'%}
    </div>
    <div>
        {% filter_all  kwargs 'category'%}
        {% filter_single category kwargs 'category'%}
    </div>

    <h2 id="查询结果">查询结果</h2>
    
        {% for row in articles %}         
  • {{ row.id }}-{{ row.title }}------[{{ row.article_type.caption }}]-[{{ row.category.caption }}]
  •     {% endfor %}     
article.html

Create templatetags directory , create the filter.py file in the directory:

from django import template
from django.utils.safestring import mark_safe
register = template.Library()
 
@register.simple_tag
def filter_all(kwargs,type_str):
    print(type_str)
    if type_str == 'article_type':
        if kwargs['article_type'] == 0:
            tmp = '<a> 全部 </a>'%(kwargs['category'])
        else:
            tmp = '<a> 全部 </a>'%(kwargs['category'])
 
    elif type_str == 'category':
        if kwargs['category'] == 0:
            tmp = '<a> 全部 </a>' % (kwargs['article_type'])
        else:
            tmp = '<a> 全部 </a>' % (kwargs['article_type'])
 
    return mark_safe(tmp)
 
@register.simple_tag()
def filter_single(type_obj,kwargs,type_str):
 
    print(type_str)
    tmp = ''
    if type_str == 'article_type':
        for row in type_obj:
            if row.id == kwargs['article_type']:
                tag = '<a>%s</a>\n'%(row.id,kwargs['category'],row.caption)
            else:
                tag = '<a>%s</a>\n' % (row.id, kwargs['category'],row.caption)
            tmp +=tag
    elif type_str == 'category':
        for row in type_obj:
            if row.id == kwargs['category']:
                tag = '<a>%s</a>\n' % (kwargs['article_type'],row.id, row.caption)
            else:
                tag = '<a>%s</a>\n' % (kwargs['article_type'], row.id, row.caption)
            tmp += tag
 
    return mark_safe(tmp)

HTML file main content:

{% load filter %}

    <h2 id="过滤条件">过滤条件</h2>
    <div>
        {% filter_all  kwargs 'article_type'%}
 
        {% filter_single article_type kwargs 'article_type'%}
    </div>
    <div>
        {% filter_all  kwargs 'category'%}
        {% filter_single category kwargs 'category'%}
    </div>
 
    <h2 id="查询结果">查询结果</h2>
    
        {% for row in articles %}         
  • {{ row.id }}-{{ row.title }}------[{{ row.article_type.caption }}]-[{{ row.category.caption }}]
  •     {% endfor %}     

JSONP

JSONP (JSON with Padding) is a "usage mode" of JSON ”, which can be used to solve the problem of cross-domain data access by mainstream browsers. Due to the same-origin policy, generally speaking, web pages located at server1.example.com cannot communicate with servers other than server1.example.com, with the exception of the HTML <script> element. Using this open policy of the <script> element, web pages can obtain JSON data dynamically generated from other sources, and this usage pattern is called JSONP. The data captured with JSONP is not JSON, but arbitrary JavaScript, which is executed with a JavaScript interpreter instead of parsed with a JSON parser. </script>

Principle:

- Create script tag

- src=remote address

-The returned data must be in js format

- Only GET requests can be sent

1. What is the same origin policy?

Processing file:

import requests
def jsonp(request):
    # 获取url信息
    response = requests.get(&#39;http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301&#39;)
    response.encoding = &#39;utf-8&#39;     # 进行编码
 
    return render(request,&#39;jsonp.html&#39;,{&#39;result&#39;:response.text})  # response.text 请求内容

HTML file:

<body>
    <h1 id="后台获取的结果">后台获取的结果</h1>
    {{ result }}
    <h1 id="js直接获取结果">js直接获取结果</h1>
    <input type="button" value="获取数据" onclick="getContent();" />
    <div id="container"></div>
    <script src="/static/jquery-1.8.2.js"></script>
    <script>
        function getContent() {
            var xhr = new XMLHttpRequest();         // 创建对象
            xhr.open(&#39;GET&#39;, &#39;http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301&#39;); // GET方式打开
            xhr.onreadystatechange = function () {  // 收到返回值时执行
                console.log(xhr.responseText);
            };
            xhr.send()  // 发送
        }
    </script>
</body>

Note: When clicking js to directly obtain the results, the browser displays the following error message because the browser only accepts http:/ The information sent by /127.0.0.1:8000 is directly blocked for the information sent by the weather website. This is the same-origin policy. Is there any way to solve it?

XMLHttpRequest cannot load http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301. No &#39;Access-Control-Allow-Origin&#39; header is present on the requested resource. Origin &#39;http://127.0.0.1:8000&#39; is therefore not allowed access.

2. Cleverly use the src attribute of the script tag

The script tag is not affected by the same-origin policy

Processing files:

import requests
def jsonp(request):
    # 获取url信息
    response = requests.get(&#39;http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301&#39;)
    response.encoding = &#39;utf-8&#39;     # 进行编码
 
    return render(request,&#39;jsonp.html&#39;,{&#39;result&#39;:response.text})  # response.text 请求内容
 
def jsonp_api(request):
    return HttpResponse('alert(123)')

HTML files:

<body>
    <h1 id="后台获取的结果">后台获取的结果</h1>
    {{ result }}
    <h1 id="js直接获取结果">js直接获取结果</h1>
    <input type="button" value="获取数据" onclick="getContent();" />
    <div id="container"></div>
    <script>
        function getContent() {
            var tag = document.createElement(&#39;script&#39;);
            tag.src = &#39;/jsonp_api.html&#39;;
            document.head.appendChild(tag);
         //   document.head.removeChild(tag);
        }
    </script>
</body>

Note: For convenience when making js requests, the current program URL is still requested; after executing the above code, you will find a magical situation , a 123 message will pop up on the page, indicating that the script successfully obtained the information

3. Slightly modify the front and back ends to make the usage more dynamic

Processing files:

def jsonp(request):
 
    return render(request,&#39;jsonp.html&#39;)  # response.text 请求内容
 
def jsonp_api(request):
    func = request.GET.get(&#39;callback&#39;)  # 获取用户callback参数
    content = &#39;%s(10000)&#39;%func          # 执行func(10000)函数
 
    return HttpResponse(content)

HTML file:

<body>
    <h1 id="后台获取的结果">后台获取的结果</h1>
    {{ result }}
    <h1 id="js直接获取结果">js直接获取结果</h1>
    <input type="button" value="获取数据" onclick="getContent();" />
    <div id="container"></div>
    <script>
        function getContent() {
            var tag = document.createElement(&#39;script&#39;);
            tag.src = &#39;/jsonp_api.html?callback=list&#39;;  // 自定义callback参数,与后台达成默契
            document.head.appendChild(tag);
         //   document.head.removeChild(tag);
        }
        function list(arg){         // 自定义函数与callback=list相对应
               alert(arg);
            }
    </script>
</body>

Note: When js sends a request, bring the callback parameter, and then define the method corresponding to the parameter. The background will pass the data into this method and execute it; as for printing or The pop-up box depends on the user's own needs; the principle and implementation process of jsonp is the implementation of the above code

4. Example application+ajax

processing files :

import requests
def jsonp(request):
    response = requests.get(&#39;http://www.jxntv.cn/data/jmd-jxtv2.html?callback=list&_=1454376870403&#39;)
    response.encoding = &#39;utf-8&#39;  # 进行编码
 
    return render(request, &#39;jsonp.html&#39;, {&#39;result&#39;: response.text})  # response.text 请求内容

HTML file:

<body>
    <h1 id="后台获取的结果">后台获取的结果</h1>
    {{ result }}
    <h1 id="js直接获取结果">js直接获取结果</h1>
    <input type="button" value="获取数据" onclick="getContent();" />
    <div id="container"></div>
    <script src="/static/jquery-1.8.2.js"></script>
    <script>
        function getContent() {
            $.ajax({
                url: &#39;http://www.jxntv.cn/data/jmd-jxtv2.html?callback=list&_=1454376870403&#39;,
                type: &#39;POST&#39;,
                dataType: &#39;jsonp&#39;,     // 即使写的type是POST也是按照GET请求发送
                jsonp: &#39;callback&#39;,
                jsonpCallback: &#39;list&#39;
            });
        }
 
        function list(arg){         // 自定义函数与callback=list相对应
            console.log(arg);
            var data = arg[&#39;data&#39;];
            for(k in data){
                var tr = document.createElement(&#39;td&#39;);
                var week = data[k][&#39;week&#39;];
                var list = data[k][&#39;list&#39;];
                tr.textContent =week
                document.body.appendChild(tr);
                console.log(week);
                for(i in list){
                    var name = list[i][&#39;name&#39;];
                    console.log(name)
        }}}
    </script>
</body>
list({data:[ { "week":"周日", "list":[ { "time":"0030", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"《都市现场》60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"《快乐生活一点通》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"《e早晨报》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"《地宝当家》(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"《都市60分》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"《谁是赢家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"《快乐生活一点通》精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"《地宝当家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"《都市现场》90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"《都市情缘》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"《晚间800》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"《都市剧场》黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"《都市剧场》黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"《拍案》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] }, { "week":"周一", "list":[ { "time":"0030", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"《都市现场》60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"《快乐生活一点通》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"《e早晨报》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"《地宝当家》(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"《都市60分》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"《谁是赢家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"《快乐生活一点通》精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"《地宝当家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"《都市现场》90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"《都市情缘》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"《晚间800》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"《都市剧场》黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"《都市剧场》黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"《拍案》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] },{ "week":"周二", "list":[ { "time":"0030", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"《都市现场》60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"《快乐生活一点通》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"《e早晨报》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"《地宝当家》(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"《都市60分》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"《谁是赢家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"《快乐生活一点通》精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"《地宝当家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"《都市现场》90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"《都市情缘》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"《晚间800》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"《都市剧场》黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"《都市剧场》黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"《拍案》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] },{ "week":"周三", "list":[ { "time":"0030", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"《都市现场》60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"《快乐生活一点通》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"《e早晨报》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"《地宝当家》(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"《都市60分》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"《谁是赢家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"《快乐生活一点通》精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"《地宝当家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"《都市现场》90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"《都市情缘》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"《晚间800》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"《都市剧场》黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"《都市剧场》黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"《拍案》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] },{ "week":"周四", "list":[ { "time":"0030", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"《都市现场》60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"《快乐生活一点通》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"《e早晨报》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"《地宝当家》(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"《都市60分》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"《谁是赢家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"《快乐生活一点通》精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"《地宝当家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"《都市现场》90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"《都市情缘》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"《晚间800》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"《都市剧场》黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"《都市剧场》黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"《拍案》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] },{ "week":"周五", "list":[ { "time":"0030", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"《都市现场》60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"《快乐生活一点通》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"《e早晨报》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"《地宝当家》(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"《都市60分》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"《谁是赢家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"《快乐生活一点通》精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"《地宝当家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"《都市现场》90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"《都市情缘》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"《晚间800》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"《都市剧场》黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"《都市剧场》黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"《拍案》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] },{ "week":"周六", "list":[ { "time":"0030", "name":"通宵剧场六集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0530", "name":"《都市现场》60分钟精编版(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0630", "name":"《快乐生活一点通》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0700", "name":"《e早晨报》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"0800", "name":"精选剧场四集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1120", "name":"《地宝当家》(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1200", "name":"《都市60分》60分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1300", "name":"《谁是赢家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1400", "name":"女性剧场三集连播", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1700", "name":"《快乐生活一点通》精编版", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1730", "name":"《地宝当家》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1800", "name":"《都市现场》90分钟直播版块", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"1930", "name":"《都市情缘》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2000", "name":"《晚间800》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2020", "name":"《都市剧场》黄金剧(第1集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2110", "name":"《都市剧场》黄金剧(第2集)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2200", "name":"《拍案》", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2230", "name":"江西新闻联播(重播)", "link":"http://www.jxntv.cn/live/jxtv2.shtml" }, { "time":"2250", "name":"都市晚剧场", "link":"http://www.jxntv.cn/live/jxtv2.shtml" } ] }] });

Note: The implementation process is exactly the same as the code written by the third person. It also creates a script and then deletes it

More Python Development [Django]: For articles related to combined search, JSONP, and XSS filtering, please pay attention to the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Python开发经验分享:如何进行版本控制和发布管理Python开发经验分享:如何进行版本控制和发布管理Nov 23, 2023 am 08:36 AM

Python开发经验分享:如何进行版本控制和发布管理引言:在Python开发过程中,版本控制和发布管理是非常重要的环节。通过版本控制,我们可以轻松地追踪代码的更改、协同开发、解决冲突等;而发布管理则能够帮助我们组织代码的部署、测试和发布过程,确保代码的质量和稳定性。本文将从版本控制和发布管理两个方面,分享一些Python开发中的经验和实践。一、版本控制版本控

Python开发注意事项:避免常见的内存泄漏问题Python开发注意事项:避免常见的内存泄漏问题Nov 22, 2023 pm 01:43 PM

Python作为一种高级编程语言,具有易学易用和开发效率高等优点,在开发人员中越来越受欢迎。但是,由于其垃圾回收机制的实现方式,Python在处理大量内存时,容易出现内存泄漏问题。本文将从常见内存泄漏问题、引起问题的原因以及避免内存泄漏的方法三个方面来介绍Python开发过程中需要注意的事项。一、常见内存泄漏问题内存泄漏是指程序在运行中分配的内存空间无法释放

Python开发建议:掌握并应用面向对象编程的原则Python开发建议:掌握并应用面向对象编程的原则Nov 22, 2023 pm 07:59 PM

Python是一门强大而灵活的编程语言,广泛应用于各种领域的软件开发。在Python开发过程中,掌握并应用面向对象编程(Object-OrientedProgramming,OOP)的原则是非常重要的。本文将介绍一些关键的Python开发建议,帮助开发者更好地掌握和应用面向对象编程的原则。首先,面向对象编程的核心思想是将问题划分为一系列的对象,并通过对象之

Python开发经验分享:如何进行代码审查和质量保证Python开发经验分享:如何进行代码审查和质量保证Nov 22, 2023 am 08:18 AM

Python开发经验分享:如何进行代码审查和质量保证导言:在软件开发过程中,代码审查和质量保证是至关重要的环节。良好的代码审查可以提高代码质量、减少错误和缺陷,提高程序的可维护性和可扩展性。本文将从以下几个方面分享Python开发中如何进行代码审查和质量保证的经验。一、制定代码审查规范代码审查是一种系统性的活动,需要对代码进行全面的检查和评估。为了规范代码审

提高Python开发效率:手把手教你配置国内pip源提高Python开发效率:手把手教你配置国内pip源Jan 17, 2024 am 10:10 AM

从零开始,一步步教你配置pip国内源,让你的Python开发更高效在Python的开发过程中,我们经常会用到pip来管理第三方库。然而,由于国内的网络环境问题,使用默认的pip源往往会导致下载速度缓慢、甚至无法连接的情况。为了让我们的Python开发更加高效,配置一个国内源是非常有必要的。那么,现在就让我们一步步来配置pip国内源吧!首先,我们需要找到pip

Python开发更顺畅:国内源下的pip安装教程Python开发更顺畅:国内源下的pip安装教程Jan 17, 2024 am 09:54 AM

pip国内源安装教程:让你的Python开发更顺畅,需要具体代码示例在Python开发中,使用pip来管理第三方库是非常常见的。然而,由于众所周知的原因,有时候直接使用官方的pip源会遇到下载速度慢、无法连接等问题。为了解决这个问题,国内出现了一些优秀的pip国内源,如阿里云、腾讯云、豆瓣等。使用这些国内源,可以极大地提高下载速度,提升Python开发的效率

Python开发建议:合理规划项目结构和模块划分Python开发建议:合理规划项目结构和模块划分Nov 22, 2023 pm 07:52 PM

Python开发是一种简单而又强大的编程语言,常被用于开发各种类型的应用程序。然而,对于初学者来说,可能会在项目结构和模块划分方面遇到一些挑战。一个良好的项目结构和模块划分不仅有助于提高代码的可维护性和可扩展性,还能提升团队开发的效率。在本文中,我们将分享一些建议,帮助您合理规划Python项目的结构和模块划分。首先,一个好的项目结构应当能够清晰地展示项目的

Python开发经验总结:提高代码安全性和防御性的方法Python开发经验总结:提高代码安全性和防御性的方法Nov 23, 2023 am 09:35 AM

Python开发经验总结:提高代码安全性和防御性的方法随着互联网的发展,代码的安全性和防御性越来越受到关注。特别是Python作为一门广泛使用的动态语言,也面临着各种潜在的风险。本文将总结一些提高Python代码安全性和防御性的方法,希望对Python开发者有所帮助。合理使用输入验证在开发过程中,用户的输入可能包含恶意代码。为了避免这种情况发生,开发者应该对

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool