会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
韩文林
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
下一页
2019年5月15日
django 数据库中中文转化为汉语拼音
摘要: 1、安装模块 django-uuslug pip install django-uuslug 2、导入模块 3、使用模块 slugify('天龙八部')'tian-long-ba-bu' 4、models中的使用
阅读全文
posted @ 2019-05-15 10:33 韩文林
阅读(731)
评论(0)
推荐(0)
2019年5月9日
python中yield的用法详解
摘要: 首先我要吐槽一下,看程序的过程中遇见了yield这个关键字,然后百度的时候,发现没有一个能简单的让我懂的,讲起来真TM的都是头头是道,什么参数,什么传递的,还口口声声说自己的教程是最简单的,最浅显易懂的,我就想问没有有考虑过读者的感受。 接下来是正题: 首先,如果你还没有对yield有个初步分认识,
阅读全文
posted @ 2019-05-09 17:26 韩文林
阅读(270)
评论(0)
推荐(0)
2019年4月30日
TemplateSyntaxError at /article/list-article-titles/admin/
摘要: 如图红圈所示,发现一个注释掉的{% if userinfo %}标签竟然可以影响后面的标签快,不能注释,需要完全删除才不会报错。 继续这类django在html模板中直接注释掉发生错误以及解决方案: python django html 代码被注释掉 依旧被解释导致报错 删掉被注释的代码没问题 注释
阅读全文
posted @ 2019-04-30 11:48 韩文林
阅读(295)
评论(0)
推荐(0)
django.template.exceptions.TemplateSyntaxError: 'article_tags' is not a registered tag library.
摘要: django.template.exceptions.TemplateSyntaxError: 'article_tags' is not a registered tag library. Must be one of:admin_listadmin_modifyadmin_staticadmin
阅读全文
posted @ 2019-04-30 11:30 韩文林
阅读(2523)
评论(1)
推荐(1)
2019年4月28日
Django Reverse for 'artic_post' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
摘要: Reverse for 'home' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] 此问题出现的原因是我的文件中出现了{{% url 'home' %}}这样的语句,url配置错误了,
阅读全文
posted @ 2019-04-28 13:19 韩文林
阅读(218)
评论(0)
推荐(0)
2019年4月9日
django2.2连接mysql遇到的坑
摘要: 1、mysql数据库配置 2、首先需要建一个myweb数据库 3、执行数据库迁移命令makemigrations 报错: 主要是说没有安装mysql客户端;但是明明安装了,因为没有mysql那个包,只有pymysql 需要在项目的目录下的__init__.py 添加如下代码;此目录C:\Users\
阅读全文
posted @ 2019-04-09 15:10 韩文林
阅读(4844)
评论(1)
推荐(1)
2019年4月8日
Git教程
摘要: 1、linux安装 2、输入git;如图成功安装 3、加入公钥到github cat ~/.ssh/id_rsa.pub 二、git命令 git diff HEAD -- code.txt HEAD表示在暂存区的文件, --表示当前工作区文件 1、git add file 添加文件到暂存区 git
阅读全文
posted @ 2019-04-08 11:19 韩文林
阅读(164)
评论(0)
推荐(0)
2019年4月3日
Python 二进制 八进制 十进制 十六进制
摘要: 1、四种进制的表示方式 2、转为二进制 bin() 3、转为八进制 oct();转为十六进制 hex() 4、Ascii码与数字ord(),chr()
阅读全文
posted @ 2019-04-03 15:15 韩文林
阅读(407)
评论(0)
推荐(0)
2019年4月1日
python3 安装turtle tkitnter 报错
摘要: 导入tkinter模块后,运行出现No module named _tkinter, please install the python-tk package ubuntu运行tkinter错误 解决 首先 然后
阅读全文
posted @ 2019-04-01 19:39 韩文林
阅读(414)
评论(0)
推荐(0)
2019年3月31日
Ubuntu 12.04 the system is running in low-graphics mode
摘要: 1、出现问题如图所示: 2、解决方案: Ctrl + Alt + F1 df -h 输入密码,到了这一步,也是可以使用terminal,那么没有图形界面也是可以的 cd /etc/X11 sudo cp xorg.conf.failsafe xorg.conf sudo reboot 3、问题解决的
阅读全文
posted @ 2019-03-31 16:23 韩文林
阅读(256)
评论(0)
推荐(0)
上一页
1
2
3
下一页
公告