
Django学习
南瓜头777
这个作者很懒,什么都没留下…
展开
-
部署django-celery
安装包# pip安装必选 Django==3.2 celery==5.0.5 redis==3.5.3 # 可选,windows下运行celery 4以后版本,还需额外安装eventlet库 eventlet # 推荐安装, 需要设置定时或周期任务时安装,推荐安装 django-celery-beat==2.2.0 # 视情况需要,需要存储任务结果时安装,视情况需要 django-celery-results==2.0.1 # 视情况需要,需要监控celery运行任务原创 2022-01-17 23:54:33 · 619 阅读 · 1 评论 -
Django自定义Some of Simple JWT’s behavior
# Django project settings.pyfrom datetime import timedelta...SIMPLE_JWT = { 'ACCESS_TOKEN_LIFETIME': timedelta(minutes=5), 'REFRESH_TOKEN_LIFETIME': timedelta(days=1), 'ROTATE_REFRESH_TOKENS': False, 'BLACKLIST_AFTER_ROTATION': False,原创 2021-10-23 17:44:48 · 182 阅读 · 0 评论 -
Django项目解决Error loading MySQLdb module
Django项目解决Error loading MySQLdb module在项目__init__.py文件中引入模块:import pymysqlpymysql.install_as_MySQLdb()解决!关注公众号一起学python原创 2021-05-24 13:33:32 · 274 阅读 · 0 评论 -
Django开发接口时setting.py源码
Django开发接口时setting.py源码import os# Build paths inside the project like this: os.path.join(BASE_DIR, ...)BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))# SECURITY WARNING: keep the secret key used in production secret!SECRET原创 2021-04-28 16:44:53 · 103 阅读 · 0 评论 -
Python之base64加密解密
Python之base64加密解密加密:import base64str1 = "hello word"str2 = str1.encode(encoding ='utf-8',errors = 'strict')str3 = base64.b64encode(str2)str4 = str3.decode()解密:enstr = base64.b64decode(str3.decode())print(enstr.decode())原创 2021-04-27 23:05:27 · 403 阅读 · 0 评论 -
解决mysqlclient 1.4.0 or newer is required; you have 0.10.0.
解决mysqlclient 1.4.0 or newer is required; you have 0.10.0.在__init__.py文件中指定版本原创 2020-09-10 11:38:30 · 3999 阅读 · 0 评论 -
把 bootstrap 框架放入插件目录 plugins?
把 bootstrap 框架放入插件目录 plugins?当在菜鸟教程看到这句话的时候瞬间懵了,怎么才能把 bootstrap 框架放入插件目录 plugins中。辛亏看到了接下来的这个路径<link rel="stylesheet" href="/static/plugins/bootstrap-3.3.7-dist/css/bootstrap.css">顿时就明白了。还要下载 bootstrap 框架。附上下载地址https://v3.bootcss.com/getting-sta原创 2020-09-10 01:02:04 · 2092 阅读 · 6 评论 -
解决<ExtendsNode: extends “base.html“> must be the first tag in the template.
<ExtendsNode: extends “base.html”> must be the first tag in the template.只要把继承部分写在外面就可以了{%extends "base.html" %}{% block mainbody %}<p>继承了 base.html 文件</p>{% endblock %}<!DOCTYPE html><html lang="en"><head> &原创 2020-09-10 01:31:21 · 1273 阅读 · 0 评论