“2018年7月”存档文章有45 篇
flask url_for 如何使用
2018/7/12 9:52:00
Flask提供了url_for()辅助函数,url_for()最简单的用法是以视图函数名作为参数,返回对应URL。例如:当当调用url_for('index')得到的结果是/,调用url_for('index', _external=True)返回的是绝对地址。如果在本博客上调用则返回:https://pdf-lib.org/。使用url_for()生成动态地址时,将动态部分关键字传入。例如:ur...
SQLAlchemy 如何更新数据库
2018/7/10 10:16:13
最近修改了模型,没有更新数据库,提交数据报错,具体报错内容如下:sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1054, "Unknown column 'body' in 'field list'") [SQL: 'INSERT INTO article (title, body, body_html...
Naval:如何不靠运气致富
2018/7/9 14:17:35
一般来说,富人不会分享自己发家致富的秘密。所以,有互联网以来,我看到许多在网上教人致富的人都发了财。在英文博客界,写关于如何发财的博文成为了一个专门的门类。而真正的有钱人只会用心灵鸡汤敷衍一下大众,根本不会提供任何方法论,更不要说是致富秘诀了。也有例外。硅谷投资人Naval Ravikant在5月31日突然一口气发了40条语录,内容就是关于如何不靠运气而致富。随后这40条文字被不断转发,翻译为多国...
AttributeError: Neither 'ColumnClause' object nor 'Comparator' object has an attribute 'dispatch'
2018/7/6 15:23:46
最近在使用Python SQLAlchemy的时候报如下错误:AttributeError: Neither 'ColumnClause' object nor 'Comparator' object has an attribute 'dispatch'看了一下代码:# 文章相关表 class Article(db.Model): __tablename__ = 'article' ...
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ow5feu0g/pycurl/
2018/7/5 17:21:19
最近要在服务器上面部署一个应用程序,但是安装的时候出现了一下问题:(venv) root@vps6:/var/pppoe-server# pip install pycurl Collecting pycurl Downloading https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52...
-bash: wget: command not found
2018/7/5 15:49:04
最近使用center os 的时候,提示:-bash: wget: command not found出现这个问题的原因:没有安装wget软件包。解决方案:yum -y install wget参考资料:-bash: wget: command not found的两种解决方法黄兵个人博客原创。转载请注明出处:黄兵个人博客 - -bash: wget: command not found
from flask.ext.pagedown import PageDown
2018/7/5 14:19:21
最近使用python的时候,需要用到pagedown,安装之后报如下错误:Usage: python -m flask run [OPTIONS] Error: While importing "manage", an ImportError was raised: Traceback (most recent call last): File "E:\Python\SMS_Re...
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
2018/7/5 13:50:27
I wanted to install scrapy in virtualenv using pip (Python 3.5) but I get the followingerror: command 'x86_64-linux-gnu-gcc' failed with exit status 1I tried with Python 2.7 but I get the same errorfo...