当前位置: 首页 > news >正文

南阳网站开发网页特效源码网站

南阳网站开发,网页特效源码网站,怎么创建网站论坛,网站开发是什么专业百度1、进入官网 2、下载 官网下载#xff1a;http://kindeditor.net/down.php 3、文件夹说明 ├── asp asp示例 ├── asp.net asp.net示例 ├── attached 空文件夹#xff0c;放置关联文件attached ├── … 1、进入官网 2、下载   官网下载http://kindeditor.net/down.php 3、文件夹说明 ├── asp asp示例 ├── asp.net asp.net示例 ├── attached 空文件夹放置关联文件attached ├── examples HTML示例 ├── jsp java示例 ├── kindeditor-all-min.js 全部JS压缩 ├── kindeditor-all.js 全部JS未压缩 ├── kindeditor-min.js 仅KindEditor JS压缩 ├── kindeditor.js 仅KindEditor JS未压缩 ├── lang 支持语言 ├── license.txt License ├── php PHP示例 ├── plugins KindEditor内部使用的插件 └── themes KindEditor主题4、基本使用 textarea namecontent idcontent/textareascript src/static/jquery-1.12.4.js/script script src/static/plugins/kind-editor/kindeditor-all.js/script script$(function () {initKindEditor();});function initKindEditor() {var kind KindEditor.create(#content, {width: 100%, // 文本框宽度(可以百分比或像素)height: 300px, // 文本框高度(只能像素)minWidth: 200, // 最小宽度数字minHeight: 400 // 最小高度数字});} /script5、详细参数      http://kindeditor.net/docs/option.html 6、上传文件示例 !DOCTYPE html html head langenmeta charsetUTF-8title/title /head bodydivh1文章内容/h1{{ request.POST.content|safe }} /divform methodPOSTh1请输入内容/h1{% csrf_token %}div stylewidth: 500px; margin: 0 auto;textarea namecontent idcontent/textarea/divinput typesubmit value提交/ /formscript src/static/jquery-1.12.4.js/script script src/static/plugins/kind-editor/kindeditor-all.js/script script$(function () {initKindEditor();});function initKindEditor() {var a kind;var kind KindEditor.create(#content, {width: 100%, // 文本框宽度(可以百分比或像素)height: 300px, // 文本框高度(只能像素)minWidth: 200, // 最小宽度数字minHeight: 400, // 最小高度数字uploadJson: /kind/upload_img/,extraFileUploadParams: {csrfmiddlewaretoken: {{ csrf_token }}},fileManagerJson: /kind/file_manager/,allowPreviewEmoticons: true,allowImageUpload: true});} /script /body /html HTML import os import json import timefrom django.shortcuts import render from django.shortcuts import HttpResponsedef index(request):首页:param request::return:return render(request, index.html)def upload_img(request):文件上传:param request::return:dic {error: 0,url: /static/imgs/20130809170025.png,message: 错误了...}return HttpResponse(json.dumps(dic))def file_manager(request):文件管理:param request::return:dic {}root_path /Users/wupeiqi/PycharmProjects/editors/static/static_root_path /static/request_path request.GET.get(path)if request_path:abs_current_dir_path os.path.join(root_path, request_path)move_up_dir_path os.path.dirname(request_path.rstrip(/))dic[moveup_dir_path] move_up_dir_path / if move_up_dir_path else move_up_dir_pathelse:abs_current_dir_path root_pathdic[moveup_dir_path] dic[current_dir_path] request_pathdic[current_url] os.path.join(static_root_path, request_path)file_list []for item in os.listdir(abs_current_dir_path):abs_item_path os.path.join(abs_current_dir_path, item)a, exts os.path.splitext(item)is_dir os.path.isdir(abs_item_path)if is_dir:temp {is_dir: True,has_file: True,filesize: 0,dir_path: ,is_photo: False,filetype: ,filename: item,datetime: time.strftime(%Y-%m-%d %H:%M:%S, time.gmtime(os.path.getctime(abs_item_path)))}else:temp {is_dir: False,has_file: False,filesize: os.stat(abs_item_path).st_size,dir_path: ,is_photo: True if exts.lower() in [.jpg, .png, .jpeg] else False,filetype: exts.lower().strip(.),filename: item,datetime: time.strftime(%Y-%m-%d %H:%M:%S, time.gmtime(os.path.getctime(abs_item_path)))}file_list.append(temp)dic[file_list] file_listreturn HttpResponse(json.dumps(dic)) views 7、XSS过滤特殊标签   处理依赖 pip3 install beautifulsoup4from bs4 import BeautifulSoupclass XSSFilter(object):__instance Nonedef __init__(self):# XSS白名单self.valid_tags {font: [color, size, face, style],b: [],div: [],span: [],table: [border, cellspacing, cellpadding],th: [colspan, rowspan],td: [colspan, rowspan],a: [href, target, name],img: [src, alt, title],p: [align],pre: [class],hr: [class],strong: []}classmethoddef instance(cls):if not cls.__instance:obj cls()cls.__instance objreturn cls.__instancedef process(self, content):soup BeautifulSoup(content, lxml)# 遍历所有HTML标签for tag in soup.find_all(recursiveTrue):# 判断标签名是否在白名单中if tag.name not in self.valid_tags:tag.hidden Trueif tag.name not in [html, body]:tag.hidden Truetag.clear()continue# 当前标签的所有属性白名单attr_rules self.valid_tags[tag.name]keys list(tag.attrs.keys())for key in keys:if key not in attr_rules:del tag[key]return soup.renderContents()if __name__ __main__:html p classtitlebThe Dormouses story/b/pp classstorydiv namerootOnce upon a time there were three little sisters; and their names werea hrefhttp://example.com/elsie classsister c1 stylecolor:red;background-color:green; idlink1!-- Elsie --/aa hrefhttp://example.com/lacie classsister idlink2Lacie/a anda hrefhttp://example.com/tillie classsister idlink3Tilffffffffffffflie/a;and they lived at the bottom of a well.scriptalert(123)/script/div/pp classstory.../pv XSSFilter.instance().process(html)print(v) XSS示例 #!/usr/bin/env python # -*- coding:utf-8 -*- from bs4 import BeautifulSoupclass XSSFilter(object):__instance Nonedef __init__(self):# XSS白名单self.valid_tags {font: [color, size, face, style],b: [],div: [],span: [],table: [border, cellspacing, cellpadding],th: [colspan, rowspan],td: [colspan, rowspan],a: [href, target, name],img: [src, alt, title],p: [align],pre: [class],hr: [class],strong: []}def __new__(cls, *args, **kwargs):单例模式:param cls::param args::param kwargs::return:if not cls.__instance:obj object.__new__(cls, *args, **kwargs)cls.__instance objreturn cls.__instancedef process(self, content):soup BeautifulSoup(content, lxml)# 遍历所有HTML标签for tag in soup.find_all(recursiveTrue):# 判断标签名是否在白名单中if tag.name not in self.valid_tags:tag.hidden Trueif tag.name not in [html, body]:tag.hidden Truetag.clear()continue# 当前标签的所有属性白名单attr_rules self.valid_tags[tag.name]keys list(tag.attrs.keys())for key in keys:if key not in attr_rules:del tag[key]return soup.renderContents()if __name__ __main__:html p classtitlebThe Dormouses story/b/pp classstorydiv namerootOnce upon a time there were three little sisters; and their names werea hrefhttp://example.com/elsie classsister c1 stylecolor:red;background-color:green; idlink1!-- Elsie --/aa hrefhttp://example.com/lacie classsister idlink2Lacie/a anda hrefhttp://example.com/tillie classsister idlink3Tilffffffffffffflie/a;and they lived at the bottom of a well.scriptalert(123)/script/div/pp classstory.../pobj XSSFilter()v obj.process(html)print(v) 基于__new__实现单例模式示例   转载于:https://www.cnblogs.com/wuyongqiang/p/7218650.html
http://www.pierceye.com/news/952632/

相关文章:

  • 网站百度快照怎么做网站调用谷歌地图
  • 扫描二维码进入公司网站怎样做代做关键词收录排名
  • flash美食网站论文架设一个网站需要多少钱
  • 做教育视频网站用什么平台好wordpress文章 代码块
  • 网站 部署 域名深圳网站建设yuntianxia
  • 做调查的网站推荐移动端网站开发教程
  • 上海品牌网站建设公司排名女生学网络营销这个专业好吗
  • 优质的邵阳网站建设企业邮箱免费登录入口
  • 网站做seo多少钱wordpress点击分类目录空白
  • 黄埔网站建设 信科网络中国企业商铺网
  • 济南快速网站排名网站开发模板系统
  • 厦门市app开发网站建设公司亚马逊雨林在地图上的位置
  • qq空间个人网站网页设计作业个人简历代码怎么写
  • 宁波网站建设团队微信网页制作的软件
  • 社区网站推广方案百度直播推广
  • 上海网站seo诊断吉林网站优化
  • 玉田网站建设做重视频网站
  • 发放淘宝优惠券的网站怎么做网站建设理论依据
  • 信用渭南网站建设做网站实例
  • 南通做百度网站的公司哪家好公司网站建站流程
  • 北京微信网站建设费用知识问答网站开发
  • 网站建设的博客做外国网用哪些网站
  • 网站两侧广告口碑营销的案例及分析
  • 有什么手机网站wordpress 编辑器增加翻译按钮
  • 深圳网站建设企怎样做好公司网站
  • 深圳注册投资公司的条件网络优化推广公司
  • 网站流量统计工具有哪些电子商务网络营销是什么
  • asp+access网站开发实例精讲网站建设开发的主要流程
  • 电子商城开发网站建设做网站推广怎么跟客户沟通
  • 个人网站排名欣赏哪个网站可以做笔译兼职