- 博客(227)
- 收藏
- 关注
转载 django前后端分离403 csrf token missing or incorrect
根据这个链接https://stackoverflow.com/a/26639895 这是一个django的跨域访问问题。 django,会对合法的跨域访问做这样的检验,cookies里面存储的’csrftoken’,和post的header里面的字段”X-CSRFToken’作比较,只有两者匹配,才能通过跨域检验。否则会返回这个错误:CSRF Failed: CSRF token mi...
2019-09-05 14:51:00
539
转载 install virtualenv without sudo
用普通用户安装virtualenvPerhaps this was valid for older versions of virtualenv. For now, if you want to run virtualenv on a machine you're not root: download and untar one if these:https://github.c...
2019-08-22 15:23:00
360
转载 Flask WTForm disable choice field
Flask disable choice fieldChoiceField = { render_kw={'disabled':''}}form.my_field.render_kw = {'disabled': 'disabled'}from:https://stackoverflow.com/a/41788487/80250...
2019-08-21 22:20:00
525
转载 安装spark 后 NoClassDefFoundError
安装spark后,hive报java.lang.NoClassDefFoundError: org/apache/hadoop/mapreduce/InputFormattrace 看是sqoop 抛出注释/etc/profile.d/hadoop_path.sh转载于:https://www.cnblogs.com/buxizhizhoum/p/11360018....
2019-08-15 19:25:00
314
转载 find 删除日志文件
find 命令删除日志文件find ./my_dir -mtime +10 -type f -deleteEXPLANATIONS./my_diryour directory (replace with your own)-mtime +10older than 10 days-type fonly files-deleteno surpris...
2019-08-09 22:22:00
499
转载 sqlalchemy 执行sql
关键需要使用textfrom sqlalchemy import create_engine, textsql = 'SELECT * FROM my_table WHERE account_id = :account_id and amount =: amount'session.execute( text(sql), {"account_id...
2019-08-08 21:36:00
234
转载 chrome插件下载
https://www.lifewire.com/install-extensions-chrome-4103627转载于:https://www.cnblogs.com/buxizhizhoum/p/11209542.html
2019-07-18 19:37:00
193
转载 request truncate large response body
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read, 512 more expected)', IncompleteReadhttps://github.com/request/request/issues/1418转载于:https://www.cn...
2019-07-10 20:28:00
167
转载 python unicode escape
from:https://stackoverflow.com/questions/44742806/how-to-remove-escape-characters-escaping-unicode-chars-from-unicode-string-in>>> test1 = u'"Hello," he\u200b said\u200f\u200e.\n\t"...
2019-07-05 18:54:00
274
转载 python Max retries exceeded with URL in requests
使用requests进行重试import requestsfrom requests.adapters import HTTPAdapterfrom requests.packages.urllib3.util.retry import Retrysession = requests.Session()retry = Retry(connect=3, ba...
2019-07-01 20:15:00
220
转载 代码行数统计
find /demo -name "*.js" |xargs cat|grep -v ^$|wc -l转载于:https://www.cnblogs.com/buxizhizhoum/p/11069088.html
2019-06-22 15:41:00
173
转载 python编码
encode decodestr --------> unicode --------> utf8 <--------- unicode <-------- decode encode# on windows python3a = "\u4e2d\u56fd\u8...
2019-06-20 18:41:00
300
转载 django improperly configured
ImproperlyConfigured: You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settingsDJANGO_SETTINGS_MODULE=project.app.settings...
2019-06-14 20:29:00
321
转载 linux磁盘空间查看
du -h --max-depth=1du -shdf -h转载于:https://www.cnblogs.com/buxizhizhoum/p/11002375.html
2019-06-11 10:57:00
140
转载 linux路由
ip route add 172.16.5.0/24 via 10.0.0.101 dev eth0route add default gw????转载于:https://www.cnblogs.com/buxizhizhoum/p/10998899.html
2019-06-10 17:10:00
129
转载 sqlalchemy create single table
User.__table__.drop(engine)User.__table__.create(engine)https://stackoverflow.com/a/45287771/8025086转载于:https://www.cnblogs.com/buxizhizhoum/p/10966135.html
2019-06-03 10:26:00
228
转载 sqlalchemy pagination
ref:https://stackoverflow.com/questions/15727155/how-to-paginate-in-flask-sqlalchemy-for-db-session-joined-queries转载于:https://www.cnblogs.com/buxizhizhoum/p/10963417.html
2019-06-02 16:55:00
383
转载 sqlalchemy delete object
In SQL Alchemy you are deleting Objects that you get with a query from the database. This you can do in 2 Ways:Deleting with query (will issue just one DELETE statement):session.query(User).f...
2019-05-31 18:56:00
319
转载 pip源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-packagehttps://mirrors.aliyun.com/pypi/simple转载于:https://www.cnblogs.com/buxizhizhoum/p/10953832.html
2019-05-31 10:24:00
121
转载 mysql 笔记
create table:CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;https://dba.stackexchange.com/a/76789/174516转载于:https://www.cnblogs.com/buxizhizhoum/p/10945214.html...
2019-05-29 17:40:00
147
转载 secure CRT显示中文
https://blog.youkuaiyun.com/zhengqijun_/article/details/70197567转载于:https://www.cnblogs.com/buxizhizhoum/p/10943697.html
2019-05-29 14:31:00
654
转载 python datetime 增减以月为单位的时间段
datetime.timedelta(days=10) # 可以datetime.timedelta(months=1) # 不可以替代:from datetime import datetimefrom dateutil.relativedelta import relativedeltaprint datetime.now() + relativedel...
2019-05-24 20:20:00
1199
转载 virtualenv笔记
virtualenv venv --python=python2.7mkvirtualenv venv --python=pythonlinux中使用virtualenvwrapper安装pip install virtualenvwrapper但是安装之后并不能直接使用,我们需要配置之后才能使用相关命令。首选找到对应的virtualenvwrapper.sh文件的路...
2019-05-23 21:27:00
127
转载 正则匹配网址
(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]http://www.cnblogs.com/speeding/p/5097790.html转载于:https://www.cnblogs.com/buxizhizhoum/p/10914529.html
2019-05-23 21:08:00
2376
转载 sqlserver
sqlserversqlcmd -S localhost -U SA -P '<YourPassword>' #sqlcmd -S 192.555.5.555 -U SA -P '<YourPassword>'https://my.oschina.net/gugudu/blog/841487转载于:https://www.cnblogs.com/b...
2019-05-17 14:24:00
150
转载 mysql 禁止外键检查
SET FOREIGN_KEY_CHECKS=0;SET FOREIGN_KEY_CHECKS=1;from:https://stackoverflow.com/a/15501754/8025086转载于:https://www.cnblogs.com/buxizhizhoum/p/10878113.html
2019-05-16 21:23:00
359
转载 sqlalchemy flush commit
https://segmentfault.com/q/1010000000698181flush 将sql发送到内存commit 真正提交转载于:https://www.cnblogs.com/buxizhizhoum/p/10869548.html
2019-05-15 15:09:00
221
转载 building sasl.wrapper extention
yuminstallgcc-c++python-devel.x86_64cyrus-sasl-devel.x86_64 pipinstallpyhs2ref:https://www.oschina.net/question/3067165_2208165转载于:https://www.cnblogs.com/buxizhizhoum/p/108...
2019-05-11 16:29:00
343
转载 mysql查询正在执行的sql
mysql> SHOW VARIABLES LIKE "general_log%";+------------------+----------------------------+| Variable_name | Value |+------------------+----------------------------+|...
2019-04-20 21:34:00
302
转载 pycharm could not connect to sftp
ssh user@host -v转载于:https://www.cnblogs.com/buxizhizhoum/p/10728756.html
2019-04-18 11:55:00
2442
转载 linux随机字符串
pwgen -s 32 1openssl passwd -saltopenssl rand -base64 32openssl rand -hex 100转载于:https://www.cnblogs.com/buxizhizhoum/p/10720642.html
2019-04-16 22:42:00
522
转载 MySQL获取group后所有组的第一条数据
https://stackoverflow.com/a/28090544/8025086https://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/转载于:https://www.cnblogs.com/buxizhizhoum/p/10658122.html...
2019-04-05 10:40:00
991
转载 python setup.py 包含静态文件及模板文件
package_data 和MANIFEST.in都写,include_package_data=Truehttps://stackoverflow.com/a/3597263/8025086转载于:https://www.cnblogs.com/buxizhizhoum/p/10645831.html
2019-04-02 22:18:00
1889
转载 linux 机器之间 zssh, rz, sz互相传输
https://www.cnblogs.com/strikebone/p/3454679.html转载于:https://www.cnblogs.com/buxizhizhoum/p/10560609.html
2019-03-19 19:02:00
294
转载 airflow笔记
airflow webserver --debug & # debug 模式,在后台启动webserverairflow list_dagsairflow list_tasks tutorial # 列出tutorial dag所有的任务airflow list_tasks tutorial --tree# tutorial dag 任务继承关系ai...
2019-03-09 16:45:00
194
转载 qingstor python-sdk 安装错误 src/MD2.c:31:20: fatal error: Python.h: No such file or directory
ubuntu安装python qingstor-sdk,src/MD2.c:31:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1Fail...
2019-02-22 09:35:00
573
转载 Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
https://github.com/justjavac/ReplaceGoogleCDN转载于:https://www.cnblogs.com/buxizhizhoum/p/10401587.html
2019-02-19 15:55:00
174
转载 ubuntu 外接显示器
xrandr --helpxrandr # 列出显示器sudo xrandr --output eDP-1 --off # 关闭eDP-1显示器sudo xrandr --output HDMI-1 --same-as eDP-1 # HDMI-1输出和eDP-1一致,类似Window 复制sudo xrandr --output HDMI-1 --mod...
2019-02-18 19:24:00
574
转载 ubuntu wps字体缺失
http://www.cnblogs.com/liangml/p/5969404.html转载于:https://www.cnblogs.com/buxizhizhoum/p/10392427.html
2019-02-17 20:04:00
416
转载 python3编译安装no module named _ssl
使用源码编译安装python3.6.7以后用pip 安装库, 出现如下问题 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connectionimport ssl提示: no module named _ssl解决方法: 在编译时添加对ss...
2019-02-17 16:28:00
347
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅