楚阿旗

博客园 首页 新随笔 联系 订阅 管理

2019年11月17日 #

摘要: 純粹紀錄寫法,以後可以用。 pagination.py from django.utils.safestring import mark_safe class Pagination: ''' ''' def __init__(self,current_page,data_list,request,p 阅读全文
posted @ 2019-11-17 20:39 楚阿旗 阅读(103) 评论(0) 推荐(0)

2019年11月15日 #

摘要: 1. 上傳tar檔並且解壓縮# tar xvf mysql-8.0.12-linux-glibc2.12-x86_64.tar(如果沒有該檔案,先將上傳的xz檔解壓縮) 2. 移動該目錄到/usr/binmv mysql-8.0.12-linux-glibc2.12-x86_64 /usr/bin/ 阅读全文
posted @ 2019-11-15 14:54 楚阿旗 阅读(102) 评论(0) 推荐(0)

摘要: 首先安裝PIL包 pip install pillow _ import random from PIL import Image, ImageDraw, ImageFont, ImageFilter def get_chars_str(): ''' :return:驗證碼字符集合 ''' _let 阅读全文
posted @ 2019-11-15 11:49 楚阿旗 阅读(110) 评论(0) 推荐(0)

2019年11月14日 #

摘要: 在一個網站中,上傳檔案也是相當重要的功能,諸如匯入或是更新用戶內容經常會用到。 首先,先解決CSRF跨域請求的安全機制。 方式一: 在form標籤中,加入 {% csrf_token %} <form id="form" action="/userinfo/" method="POST"> {% c 阅读全文
posted @ 2019-11-14 11:01 楚阿旗 阅读(78) 评论(0) 推荐(0)