原创 python lstrip

python lstrip 1. str.strip() 用於截取str邊的空格 如: " llldddkkk ".strip() ==> "llldddkkk" 2. str.lstrip(“/”) 用於截取str兩遍

原创 在django-rest-framework 裏使用全文搜索框架 haystack 和 drf_haystack

在django-rest-framework 裏使用全文搜索框架 haystack 和 drf_haystack 參考http://drf-haystack.readthedocs.io/en/latest/01_intro.html

原创 使用django富文本編輯器ckeditor

django富文本編輯器 1. djang-ckeditor pip install django-ckeditor # 在installed_apps 裏面配置'ckeditor',修改LANGUEAGE_CODE = 'zh-hans

原创 js截取字符串

js截取字符串 var a = “abcdef”; 1. 常用的方法: a.length ==> 6 a.CharAt(0) ==> a a.CharAt(a.length-1) ==> f 2. substring用法: 截取字符串,

原创 Django常用的標籤過濾器

Django的標籤過濾器 參考https://docs.djangoproject.com/en/1.11/ref/templates/builtins/#std:templatefilter-date 1. truncatechars: