动态 版块 发帖 消息 我的
xwylt
书山有路勤为径,学海无涯苦作舟
子版块
lytcreate
1037
颜色码对照表颜色英文代码形象描述十六进制RGB LightPink浅粉红#FFB6C1255,182,193 Pink粉红#FFC0CB255,192,203 Crimson猩红#DC143C220,20,60 LavenderBlush脸红的淡紫色#FFF0F5255,240,245 PaleVioletRed苍白的紫罗兰红色#DB7093219,112,147 HotPink热情的粉红#FF69B4255,105,180 DeepPink深粉色#FF1493255,20,147 MediumVioletRed适中的紫罗兰红色#C71585199,21,133 Orchid兰花的紫色#DA70D6218,112,214 Thistle蓟#D8BFD8216,191,216 plum李子#DDA0DD221,160,221 Violet紫罗兰#EE82EE238,130,238 Magenta洋红#FF00FF255,0,255 Fuchsia灯笼海棠(紫红色)#FF00FF255,0,255 DarkMagenta深洋红色#8B008B139,0,139 Purple紫色#800080128,0,128 MediumOrchid适中的兰花紫#BA55D3186,85,211 DarkVoilet深紫罗兰色#9400D3148,0,211 DarkOrchid深兰花紫#9932CC153,50,204 Indigo靛青#4B008275,0,130 BlueViolet深紫罗兰的蓝色#8A2BE2138,43,226 MediumPurple适中的紫色#9370DB147,112,219 MediumSlateBlue适中的板岩暗蓝灰色#7B68EE123,104,238 SlateBlue板岩暗蓝灰色#6A5ACD106,90,205 DarkSlateBlue深岩暗蓝灰色#483D8B72,61,139 Lavender熏衣草花的淡紫色#E6E6FA230,230,250 GhostWhite幽灵的白色#F8F8FF248,248,255 Blue纯蓝#0000FF0,0,255 MediumBlue适中的蓝色#0000CD0,0,205 MidnightBlue午夜的蓝色#19197025,25,112 DarkBlue深蓝色#00008B0,0,139 Navy海军蓝#0000800,0,128 RoyalBlue皇家蓝#4169E165,105,225 CornflowerBlue矢车菊的蓝色#6495ED100,149,237 LightSteelBlue淡钢蓝#B0C4DE176,196,222 LightSlateGray浅石板灰#778899119,136,153 SlateGray石板灰#708090112,128,144 DoderBlue道奇蓝#1E90FF30,144,255 AliceBlue爱丽丝蓝#F0F8FF240,248,255 SteelBlue钢蓝#4682B470,130,180 LightSkyBlue淡蓝色#87CEFA135,206,250 SkyBlue天蓝色#87CEEB135,206,235 DeepSkyBlue深天蓝#00BFFF0,191,255 LightBLue淡蓝#ADD8E6173,216,230 PowDerBlue火药蓝#B0E0E6176,224,230 CadetBlue军校蓝#5F9EA095,158,160 Azure蔚蓝色#F0FFFF240,255,255 LightCyan淡青色#E1FFFF225,255,255 PaleTurquoise苍白的绿宝石#AFEEEE175,238,238 Cyan青色#00FFFF0,255,255 Aqua水绿色#D4F2E7212,242,231 DarkTurquoise深绿宝石#00CED10,206,209 DarkSlateGray深石板灰#2F4F4F47,79,79 DarkCyan深青色#008B8B0,139,139 Teal水鸭色#0080800,128,128 MediumTurquoise适中的绿宝石#48D1CC72,209,204 LightSeaGreen浅海洋绿#20B2AA32,178,170 Turquoise绿宝石#40E0D064,224,208 Auqamarin绿玉\碧绿色#7FFFAA127,255,170 MediumAquamarine适中的碧绿色#00FA9A0,250,154 MediumSpringGreen适中的春天的绿色#00FF7F0,255,127 MintCream薄荷奶油#F5FFFA245,255,250 SpringGreen春天的绿色#3CB37160,179,113 SeaGreen海洋绿#2E8B5746,139,87 Honeydew蜂蜜#F0FFF0240,255,240 LightGreen淡绿色#90EE90144,238,144 PaleGreen苍白的绿色#98FB98152,251,152 DarkSeaGreen深海洋绿#8FBC8F143,188,143 LimeGreen酸橙绿#32CD3250,205,50 Lime酸橙色#00FF000,255,0 ForestGreen森林绿#228B2234,139,34 Green纯绿#0080000,128,0 DarkGreen深绿色#0064000,100,0 Chartreuse查特酒绿#7FFF00127,255,0 LawnGreen草坪绿#7CFC00124,252,0 GreenYellow绿黄色#ADFF2F173,255,47 OliveDrab橄榄土褐色#556B2F85,107,47 Beige米色(浅褐色)#F5F5DC245,245,220 LightGoldenrodYellow浅秋麒麟黄#FAFAD2250,250,210 Ivory象牙#FFFFF0255,255,240 LightYellow浅黄色#FFFFE0255,255,224 Yellow纯黄#FFFF00255,255,0 Olive橄榄#808000128,128,0 DarkKhaki深卡其布#BDB76B189,183,107 LemonChiffon柠檬薄纱#FFFACD255,250,205 PaleGodenrod灰秋麒麟#EEE8AA238,232,170 Khaki卡其布#F0E68C240,230,140 Gold金#FFD700255,215,0 Cornislk玉米色#FFF8DC255,248,220 GoldEnrod秋麒麟#DAA520218,165,32 FloralWhite花的白色#FFFAF0255,250,240 OldLace老饰带#FDF5E6253,245,230 Wheat小麦色#F5DEB3245,222,179 Moccasin鹿皮鞋#FFE4B5255,228,181 Orange橙色#FFA500255,165,0 PapayaWhip番木瓜#FFEFD5255,239,213 BlanchedAlmond漂白的杏仁#FFEBCD255,235,205 NavajoWhite纳瓦霍白#FFDEAD255,222,173 AntiqueWhite古代的白色#FAEBD7250,235,215 Tan晒黑#D2B48C210,180,140 BrulyWood结实的树#DEB887222,184,135 Bisque(浓汤)乳脂,番茄等#FFE4C4255,228,196 DarkOrange深橙色#FF8C00255,140,0 Linen亚麻布#FAF0E6250,240,230 Peru秘鲁#CD853F205,133,63 PeachPuff桃色#FFDAB9255,218,185 SandyBrown沙棕色#F4A460244,164,96 Chocolate巧克力#D2691E210,105,30 SaddleBrown马鞍棕色#8B4513139,69,19 SeaShell海贝壳#FFF5EE255,245,238 Sienna黄土赭色#A0522D160,82,45 LightSalmon浅鲜肉(鲑鱼)色#FFA07A255,160,122 Coral珊瑚#FF7F50255,127,80 OrangeRed橙红色#FF4500255,69,0 DarkSalmon深鲜肉(鲑鱼)色#E9967A233,150,122 Tomato番茄#FF6347255,99,71 MistyRose薄雾玫瑰#FFE4E1255,228,225 Salmon鲜肉(鲑鱼)色#FA8072250,128,114 Snow雪#FFFAFA255,250,250 LightCoral淡珊瑚色#F08080240,128,128 RosyBrown玫瑰棕色#BC8F8F188,143,143 IndianRed印度红#CD5C5C205,92,92 Red纯红#FF0000255,0,0 Brown棕色#A52A2A165,42,42 FireBrick耐火砖#B22222178,34,34 DarkRed深红色#8B0000139,0,0 Maroon栗色#800000128,0,0 White纯白#FFFFFF255,255,255 WhiteSmoke白烟#F5F5F5245,245,245 Gainsboro亮灰色#DCDCDC220,220,220 LightGrey浅灰色#D3D3D3211,211,211 Silver银白色#C0C0C0192,192,192 DarkGray深灰色#A9A9A9169,169,169 Gray灰色#808080128,128,128 DimGray暗淡的灰色#696969105,105,105 Black纯黑#0000000,0,0
 4   2  212天前
lytcreate
4
views.py pagenitor = Paginator(tz_list,100) #每页的数据分多少行 page_num = pagenitor.num_pages #获取总页数 curuent_page_num = int(request.GET.get('page',1)) #获取当前页数,默认为1 curuent_page = pagenitor.page(curuent_page_num) if page_num < 11: pag_range = pagenitor.page_range else: cha = page_num - curuent_page_num if cha >10: pag_range = range(curuent_page_num,curuent_page_num+11) else: pag_range = range(page_num-10,page_num+1) num = len(tz_list)html <style> .taizhang { text-align:right; } .taizhang-1:hover{ color:red; cursor:pointer; } </style><div class="taizhang"> <tr> {% if not curuent_page.has_previous %} <td> <a href="#"> <span style="color:#1E90FF;font-weight:blod">上一页</span> </a> </td>&nbsp {% else %} <td> <a href="?page={{ curuent_page.previous_page_number }}&zclx={{ zclx }}&lxh={{ lxh }}&zcbh={{ zcbh }}&ccbh={{ ccbh }}&xcqy={{ xcqy }}&swcfd={{ swcfd }}&syz={{ syz }}&sbqk={{ sbqk }}"> <span style="color:#1E90FF;font-weight:blod">上一页</span> </a> </td>&nbsp {% endif %} {% for p_range in pag_range %} {% if p_range == curuent_page_num %} <td> <a href="?page={{ p_range }}&zclx={{ zclx }}&lxh={{ lxh }}&zcbh={{ zcbh }}&ccbh={{ ccbh }}&xcqy={{ xcqy }}&swcfd={{ swcfd }}&syz={{ syz }}&sbqk={{ sbqk }}" style="color:red">{{ p_range }}</a> </td>&nbsp {% else %} <td> <a href="?page={{ p_range }}&zclx={{ zclx }}&lxh={{ lxh }}&zcbh={{ zcbh }}&ccbh={{ ccbh }}&xcqy={{ xcqy }}&swcfd={{ swcfd }}&syz={{ syz }}&sbqk={{ sbqk }}" class="taizhang-1">{{ p_range }}</a> </td>&nbsp {% endif %} {% endfor %} {% if not curuent_page.has_next %} <td> <a href="?page={{ curuent_page_num }}&zclx={{ zclx }}&lxh={{ lxh }}&zcbh={{ zcbh }}&ccbh={{ ccbh }}&xcqy={{ xcqy }}&swcfd={{ swcfd }}&syz={{ syz }}&sbqk={{ sbqk }}"> <span style="color:#1E90FF;font-weight:blod">下一页</span> </a> </td>&nbsp {% else %} <td> <a href="?page={{ curuent_page.next_page_number }}&zclx={{ zclx }}&lxh={{ lxh }}&zcbh={{ zcbh }}&ccbh={{ ccbh }}&xcqy={{ xcqy }}&swcfd={{ swcfd }}&syz={{ syz }}&sbqk={{ sbqk }}"> <span style="color:#1E90FF;font-weight:blod">下一页</span> </a> </td>&nbsp {% endif %} </tr> </div>curuent_page
 0   0  3小时前
lytcreate
10
pycharm激活码获取
 0   0  15小时前
lytcreate
10
command+空格聚焦搜索:~/Library/Application Support进入application support 文件夹新建pip文件夹,下面新建pip.conf文件文件内容:[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple/[install]trusted-host=pypi.tuna.tsinghua.edu.cn
 0   0  16小时前
lytcreate
19
res = re.search('^(?=.{8,16})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\W).*$',newpassword) if res: print('密码ok') else: print('密码不ok')
 0   0  1天前
lytcreate
17
#默认密码修改装饰器 def password_required(func): def wrapper(request,*args,**kwargs): if request.user.is_first == 1: return redirect('changepassword.html') return func(request,*args,**kwargs) return wrapper使用: @password_required def xx(request): xxxx
 0   0  1天前
lytcreate
27
{#author:lytcreate#} {#blog:liveblog#} {#website:https://b.lytcreate.com#} {#powered by Django#} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>注册-LiveBlog-极简主义个人博客- Designed by Lytcreate</title> <link rel="stylesheet" href="../static/css/style.css"> {% load static %} <link rel="shortcut icon" href="{%static "../static/images/favicon.ico" %}"/> <script type="text/javascript"> function yanzheng() { document.registers.action ="/registers.html"; document.registers.submit(); } function register() { document.registers.action ="/register.html"; document.registers.submit(); } </script> </head> <body class='mainbody'> <div class="container"> <div class="row clearfix"> <div class="col-md-12 column"> <form action="" class="form-horizontal" method="post" name="registers">{% csrf_token %} <h3>Register</h3> <div class="form-group"> <label for="inputEmail3" class="col-sm control-label" >Username:</label> <div class="col-sm-10"> <input type="text" class="form-control" name="username" required="required" minlength="2" value="{{ username }}"/> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">Password:</label> <div class="col-sm-10"> <input type="password" class="form-control" id="inputPassword3" name="password" required="required" minlength="6" value="{{ password }}"/> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm control-label" >Email:</label> <div class="col-sm-10"> <input type="email" class="form-control" name="email" required="required" value="{{ email }}"/> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm control-label" >Verification Code:&nbsp&nbsp<input type="button" class="registercode" onclick="yanzheng()" value="{{ yzm }}"></label> <div class="col-sm-10"> <input type="email" class="form-control" name="yanzhengma"/> </div> </div> <div class="form-group"> <div class="tishi">{{ tishi }}</div><br> <div class="col-sm-offset-2 col-sm-10"> <input type="button" class="btn btn-success" onclick="register()" value="Register"> <button type="button" onclick="window.location.href='/login.html'" class="btn btn-success">Sign in</button> </div> </div> </form> </div> </div> </div> <div class="lfooter">LiveBlog - <label>人生若只如初见</label></div> </body> </html># def register(request): # if request.method == 'GET': # username ='' # password='' # email='' # yzm = '获取验证码' # return render(request,'register.html',{'username':username,'password':password,'email':email,'yzm':yzm}) # else: # name = request.POST.get('username') # password = request.POST.get('password') # email = request.POST.get('email') # yanzhengma = request.POST.get('yanzhengma') # yzm = '获取验证码' # user = User.objects.filter(username=name) # mail = User.objects.filter(email=email) # if not user: # if not mail: # if yanzhengma == request.session.get('VCode'): # User.objects.create_user(username=name, password=password, email=email) # return redirect("/login.html") # else: # tishi = '验证码错误,请重新获取验证码!' # return render(request,'register.html',{'tishi':tishi,'username':name,'password':password,'email':email,'yzm':yzm}) # else: # tishi = '这个邮箱已经被别人占用咯,重新选一个吧!' # return render(request, 'register.html', # {'tishi': tishi, 'username': name, 'password': password, 'email': email, 'yzm': yzm}) # # 此处的User 是 django 自带的model # else: # tishi = '用户名已存在,请重新输入一个有趣的名字吧!' # return render(request,'register.html',{'tishi':tishi,'username':name,'password':password,'email':email,'yzm':yzm}) # # # def registers(request): # if request.method == 'GET': # yzm = '获取验证码' # return render(request,'register.html',{'yzm':yzm}) # else: # username = request.POST.get("username") # password = request.POST.get("password") # email = request.POST.get("email") # if email =='': # tishi = '邮箱不能为空!' # yzm = '获取验证码' # return render(request, 'register.html', # {'username': username, 'password': password, 'email': email, 'yzm': yzm,'tishi':tishi}) # # print(email) # else: # zccode = str(random.randint(000000, 999999)) # request.session['VCode'] = zccode # send_mail('Liveblog注册验证码', '这是您的注册验证码:' + zccode + ',如果不是本人注册请忽略此条信息!人生若只如初见,Liveblog伴您记录美好时光!', # 'liveblog@qq.com', # [email], fail_silently=False) # yzm = '验证码已发' # return render(request, 'register.html', # {'username': username, 'password': password, 'email': email, 'yzm': yzm})
 0   0  2天前
lytcreate
36
关键字:正则匹配原url: daily.html?read=6新url: daily/6.html由于在更改url之前,所有的views函数已经写好了,所以只记录重点部分daily() get需要获取read(文章的ID)参数,为字符型urls.py修改:path('daily.html',views.daily)修改为(后面也可以加name属性方便后续修改,此处未用到:url(r'^daily/(\d)*.html$',views.daily),(\d)正则表达式匹配数字,同时需要修改daily( )处传值:由原来的 def daily(request):修改为:def daily(request,read) #其中read是后面需要用到的日志id值,也是链接过来的值除此以外,还需要修改相关前端网页的显示,比如首页链接到某一篇日志的超链接页需要修改为:/daily/ {{ 日志ID变量 }}.html拓展:常用的正则表达式a|b 匹配a或者b \d 匹配任意数字 \D 匹配任意非数字 \A 匹配字符串开始 \Z 匹配字符串结束,换行符也算 \z 匹配字符串结束
 0   0  5天前
lytcreate
39
django部署之后,一直无法看到浏览器显示favicon.ico图片,作为有强迫症的我,老是想把它弄出来,所以找啊找,终于把问题找到了,原来是因为base.html的编码是utf-8 bom 而其他继承的页面都是utf-8 编码格式不一致导致的,使用npd++全部改成utf-8就好啦 !
 0   0  6天前
lytcreate
38
事情经过:django部署成功之后,网站可以访问(b.lytcreate.com) ,说说可以正常查看与发布,但是日志只能看,提交评论之后网站就会卡住,然后一直到出现504超时,后来进行排查,先注释掉保存评论的代码,发现无效果,又注释掉邮件发送的代码,生效了,说明是邮件部分的问题,突然想到是不是没有开这个端口,开了25端口之后还是无效又去网上找资料,尝试把25改为465并在服务器上放行,终于可以了!需要修改seetings.py的邮件配置部分的内容,QQ邮箱的配置仅供参考:EMAIL_USE_TLS = False #是否使用TLS安全传输协议(用于在两个通信应用程序之间提供保密性和数据完整性。) EMAIL_USE_SSL = True #是否使用SSL加密,qq企业邮箱要求使用 EMAIL_HOST = 'smtp.qq.com' #发送邮件的邮箱 的 SMTP服务器 EMAIL_PORT = 465 #发件箱的SMTP服务器端口
 0   0  6天前
lytcreate
35
顺序:第一张是查看源代码的head部分;第二张是base页面部分;第三张是home页继承的
 0   1  6天前
我的小伙伴
Powered by Xwylt.com
© 2020-2021 lytcreate
您的IP:3.236.228.250,2021-04-17 16:13:57,Processed in 0.02443 second(s).
Powered by HadSky
书山有路勤为径,学海无涯苦作舟