“Django基础”的版本间的差异
(未显示同一用户的84个中间版本) | |||
第1行: | 第1行: | ||
[[category:django]] | [[category:django]] | ||
=进阶= | =进阶= | ||
+ | Friday May 13 2022 django 3.2 LTS | ||
老齐的东西 | 老齐的东西 | ||
[https://qiwsir.gitee.io/mathmetics/b01-01.html 老齐教室-机器学习数学基础] | [https://qiwsir.gitee.io/mathmetics/b01-01.html 老齐教室-机器学习数学基础] | ||
− | [[新建django project的基本步骤]] | + | |
+ | [https://www.cnblogs.com/yinzhengjie/tag/Django%E5%BC%80%E5%8F%91/ 当前标签:Django开发 ] | ||
+ | |||
+ | [https://blog.csdn.net/qq_40947673/article/details/104106573 python+Django+mysql+bootstrap(前端,数据库一次搞定)从头教你毕设实现一个简易好看的仓储物资管理之类系统] | ||
+ | |||
+ | [https://www.cnblogs.com/bad-robot/p/9737640.html Web开发:常用框架 常用的WSGI服务器] | ||
+ | |||
+ | https://www.cnblogs.com/bad-robot/category/1271241.html | ||
+ | |||
+ | [[Python虚拟环境virtualenv]] | ||
+ | |||
+ | [[新建django project的基本步骤]] 站内知识 | ||
+ | |||
+ | [[How to use Django with Gunicorn]] | ||
+ | |||
+ | |||
+ | [https://github.com/kurolz/VueDjangoFrameWorkShop 前端Vue结合后端DjangoFramework的在线生鲜超市(前后端分离)] | ||
+ | |||
+ | [https://blog.csdn.net/weixin_39549936/article/details/111435144 用python获取股票数据、通过django用web展示_通过django搭建一个简易的web页面(实现数据的查询、添加、修改、删除)] | ||
+ | |||
+ | ==django + vue前后端分离== | ||
+ | |||
+ | [https://blog.csdn.net/ssjdoudou/article/details/104396296 Django个人博客搭建教程---用Vue写你的第一个前后端分离页面] | ||
+ | |||
+ | [https://www.jianshu.com/p/fa0ae80d17d1 Django Vue.js搭建前后端分离项目超详细过程] | ||
+ | == django源码== | ||
+ | |||
+ | [https://www.zhihu.com/question/376445434 求大神指教,如何学习Django源码?] | ||
+ | |||
+ | [https://juejin.cn/post/6844904064577191950 Django源码分析(四):请求来了 ] | ||
+ | ==Django authentication system 内置用户权限管理== | ||
+ | https://docs.djangoproject.com/en/1.10/topics/auth/default/ | ||
+ | |||
+ | == django 注册功能== | ||
+ | 没有自带 但有很好的第三方 django-regisstration https://django-registration.readthedocs.io/en/2.0.4/install.html | ||
+ | |||
+ | API Django social auth https://github.com/omab/django-social-auth | ||
+ | |||
+ | ==django 视频 2024 == | ||
+ | |||
+ | [https://www.bilibili.com/video/BV1jR4y1p7qR?spm_id_from=333.788.videopod.episodes&vd_source=e3e41ea2b1d70e0e3a6a0372ee88d714&p=86 django基础html] | ||
+ | |||
+ | |||
+ | https://www.bilibili.com/video/BV1iX4y1c79F/?spm_id_from=333.999.0.0&vd_source=e3e41ea2b1d70e0e3a6a0372ee88d714 | ||
+ | |||
=tutorial= | =tutorial= | ||
+ | <pre> | ||
+ | |||
+ | kali 2024 | ||
+ | |||
+ | sudo pip3 install Django==1.11.1 --break-system-packages | ||
+ | |||
+ | 版本查看 现在 用3.2 LTS may 2022 | ||
$ python3 -m pip install Django==2.2 | $ python3 -m pip install Django==2.2 | ||
python -m django --version | python -m django --version | ||
+ | |||
+ | |||
+ | 编辑 models.py 文件,改变模型。 | ||
+ | 运行 python manage.py makemigrations 为模型的改变生成迁移文件。 | ||
+ | 运行 python manage.py migrate 来应用数据库迁移。 | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | ===tutorial2=== | ||
+ | https://docs.djangoproject.com/zh-hans/2.2/intro/tutorial03/ | ||
+ | devops/django/djtmp/ | ||
+ | |||
+ | [https://www.runoob.com/django/django-tutorial.html Django 教程] | ||
+ | |||
+ | =django4= | ||
+ | |||
+ | [https://www.w3cschool.cn/django4/ django4教程] | ||
=install= | =install= | ||
+ | dj 1.10 or 1.11 应该得用docker | ||
+ | ==docker 跑django 1.10 == | ||
+ | |||
+ | ===alpine 3.12=== | ||
+ | <pre> | ||
+ | registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:adj1.10.8v1 | ||
+ | |||
+ | docker run -itd --name a110 -p8000:8000 -v /home/evan/data/github/django/project/laoqi/adj110:/root registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:adj1.10.8v1 | ||
+ | |||
+ | docker exec -it a110 sh | ||
+ | |||
+ | python manage.py runserver 0.0.0.0:8000 | ||
+ | |||
+ | sqlite :DB Browser for SQLite or DBeaver | ||
+ | |||
+ | |||
+ | python manage.py createsuperuser --username=evan [email protected] | ||
+ | </pre> | ||
+ | |||
+ | ===ubuntu 18=== | ||
+ | <pre> | ||
+ | cd /home/evan/data/github/django/project/laoqi/dj110 | ||
+ | sudo code mysite --user-data-dir='.' --no-sandbox | ||
+ | |||
+ | |||
+ | #进入docker | ||
+ | docker pull ubuntu:18.04 | ||
+ | docker run -itd --name ubuntu-18 ubuntu:18.04 | ||
+ | docker exec -it ubuntu-18 /bin/bash | ||
+ | |||
+ | |||
+ | apt update | ||
+ | apt install python3-pip | ||
+ | cd /root | ||
+ | mkdir .pip | ||
+ | echo '[global] | ||
+ | index-url = https://mirrors.aliyun.com/pypi/simple/ | ||
+ | format = columns | ||
+ | |||
+ | [install] | ||
+ | trusted-host=mirrors.aliyun.com | ||
+ | ' >.pip/pip.conf | ||
+ | |||
+ | pip3 install Django==1.10.1 | ||
+ | django-admin startproject mytest | ||
+ | |||
+ | #把运行中的 ubuntu 18.04 打包为image 并 push 到ali | ||
+ | docker ps | grep ubuntu | ||
+ | docker commit 9db9b8deb4a0 django1.10 | ||
+ | docker tag 2e30489fdc69 registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 | ||
+ | docker push registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 | ||
+ | registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10v2 | ||
+ | #-v 数据共享 但是得sudo code | ||
+ | docker run -itd --name dj110 -p8000:8000 -v /home/evan/data/github/django/project/laoqi/dj110:/root registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 | ||
+ | |||
+ | docker run -itd --name dj110 -p8000:8000 registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 | ||
+ | |||
+ | docker exec -it dj110 /bin/bash | ||
+ | |||
+ | python3 manage.py runserver 0.0.0.0:8000 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | https://github.com/docker-library/django/blob/d7f1d0e61cffe81d6ca9797c63fc25eba7e277db/3.4/Dockerfile | ||
+ | |||
+ | https://hub.docker.com/_/django | ||
+ | |||
+ | Django框架更新较为频繁,每个版本之间总是有些差异的,因此可以根据下面的python和Django匹配情况选择版本进行安装。 | ||
+ | |||
+ | Django对python各版本的支持情况如下表: | ||
+ | Django version Python version | ||
+ | 1.8 2.7,3.3,3.4,3.5 | ||
+ | 1.9,1.10 2.7,3.4,3.5 | ||
+ | 1.11 2.7,3.4,3.5,3.6 | ||
+ | 2.0 3.5+ | ||
+ | |||
+ | |||
+ | pi3 上安装最新版本是可以的 | ||
+ | |||
+ | python3 -c "import django" | ||
+ | sudo pip3 install Django==1.10.1 --break-system-packages | ||
+ | |||
+ | tmp django-admin startproject mysite | ||
+ | Traceback (most recent call last): | ||
+ | File "/usr/local/bin/django-admin", line 5, in <module> | ||
+ | from django.core.management import execute_from_command_line | ||
+ | |||
+ | startproject 也不行 看来是环境问题 | ||
+ | apt install python3-django | ||
+ | |||
+ | |||
+ | python3 manage.py runserver 0.0.0.0:8000 | ||
+ | |||
[https://www.django.cn/article/show-22.html Ubuntu部署Django项目方法详解 ng uswi] | [https://www.django.cn/article/show-22.html Ubuntu部署Django项目方法详解 ng uswi] | ||
第44行: | 第208行: | ||
安装requirements.txt依赖 | 安装requirements.txt依赖 | ||
pip install -r requirements.txt | pip install -r requirements.txt | ||
+ | |||
+ | =Django结合Pyecharts实现数据可视化= | ||
+ | |||
+ | [[数据可视化图形展示pyecharts]] 大部分在这里啦 | ||
+ | |||
+ | https://blog.csdn.net/qq_34156628/article/details/106308176 | ||
+ | |||
+ | 我的代码 在 https://github.com/evan886/pyecharts-learn | ||
+ | |||
+ | =celery= | ||
+ | Celery是由Python开发、简单、灵活、可靠的分布式任务队列,其本质是生产者消费者模型,生产者发送任务到消息队列,消费者负责处理任务 | ||
+ | |||
+ | Celery由以下四部分构成:任务模块(Task)、消息中间件(Broker)、任务执行单元Worker、结果存储(Backend) | ||
+ | 任务模块Task:包含异步任务和定时任务,异步任务通常在业务逻辑中被触发并发往任务队列,而定时任务由Celery Beat进程周期性的将任务发往任务队列 | ||
+ | 消息中间件Broker:即为任务调度队列,接收任务生产者发来的消息(即任务),将任务存入队列。Celery本身不提供队列服务,官方提供了很多备选方案,支持RabbitMQ、Redis、Amazon SQS等,官方推荐RabbitMQ。 | ||
+ | 任务执行单元Worker:Worker是任务执行单元,负责从消息队列中取出任务执行,它可以启动一个或者多个,也可以启动在不同的机器节点,这就是其实现分布式的核心。实时监控消息队列,获取队列中调度的任务并执行它。 | ||
+ | 结果存储Backend:用于存储任务的执行结果。官方提供了诸多的存储方式支持:RabbitMQ、 Redis、Memcached、SQLAlchemy、Django ORM、Apache Cassandra、Elasticsearch | ||
+ | |||
+ | Django中使用定时任务 | ||
+ | |||
+ | 如果想要在django中使用定时任务功能同样是靠beat完成任务发送功能,当在Django中使用定时任务时,需要安装django-celery-beat插件。以下将介绍使用过程。 | ||
+ | |||
+ | |||
+ | ==learn== | ||
+ | learn Django中使用Celery 讲的一样有 refu api | ||
+ | |||
+ | [https://blog.csdn.net/jiandanokok/article/details/102335091 【good】【异步/定时任务】Django中使用Celery实现异步和定时任务] | ||
+ | [https://blog.csdn.net/bbwangj/article/details/89312355 转Django+Django-Celery+Celery的整合实战] | ||
+ | |||
+ | [https://www.cnblogs.com/znicy/p/5626040.html 异步任务队列Celery在Django中的使用 ] | ||
+ | |||
+ | https://docs.celeryproject.org/en/v4.3.0/getting-started/next-steps.html#using-celery-in-your-application | ||
+ | |||
+ | [https://www.cnblogs.com/wdliu/p/9517535.html 分布式任务队列Celery入门与进阶 ] | ||
+ | |||
+ | [https://www.cnblogs.com/wdliu/p/9530219.html Django中使用Celery ] | ||
+ | |||
+ | [https://www.cnblogs.com/wumingxiaoyao/p/8521567.html Django中使用Celery实现定时任务(用djcelery) ] | ||
+ | |||
+ | [https://www.celerycn.io/fu-lu/django celery集合django使用] | ||
+ | |||
+ | |||
+ | [https://www.jianshu.com/p/b6f08341a3ec celery任务状态监控] | ||
+ | |||
+ | |||
+ | [https://blog.csdn.net/zw496862766/article/details/103794727 异步服务Celery生产者消费者模式redis为数据库支撑] | ||
+ | |||
+ | [https://segmentfault.com/a/1190000016082551 3-django进阶之celery] | ||
+ | |||
+ | ==flower== | ||
+ | pip install flower | ||
+ | |||
+ | Usage Examples | ||
+ | |||
+ | Launch the Flower server at specified port other than default 5555 (open the UI at http://localhost:5566): | ||
+ | |||
+ | $ celery flower --port=5566 | ||
+ | https://flower.readthedocs.io/en/latest/install.html | ||
+ | |||
+ | |||
+ | ==相关的任务队列== | ||
+ | |||
+ | Django-Q | ||
+ | [https://zhuanlan.zhihu.com/p/59072252 django Q 的使用方法] | ||
+ | |||
+ | =提高django的并发能力= | ||
+ | [https://zhuanlan.zhihu.com/p/27467118 如何提高django的并发能力] | ||
+ | =常用知识= | ||
+ | |||
+ | == Json序列化和反序列化模块dumps、dump、loads、load功能== | ||
+ | Json的序列化和反序列化: | ||
+ | |||
+ | 序列化: 将Python对象转换为Json字符串 - - - > dumps和dump | ||
+ | 反序列化: 将Json字符串转换为Python对象 - - - > loads和load | ||
+ | |||
+ | [https://www.cnblogs.com/yinzhengjie/p/10287458.html 运维开发笔记整理-序列化] | ||
+ | |||
+ | [https://blog.csdn.net/Wangtuo1115/article/details/105664725?spm=1001.2014.3001.5501 Json序列化和反序列化模块dumps、dump、loads、load功能介绍] | ||
+ | |||
+ | == Django HttpResponse与JsonResponse== | ||
+ | [https://www.jianshu.com/p/94785f71fdd8 Django HttpResponse与JsonResponse] | ||
+ | |||
+ | == Django的objects.get和objects.filter方法详解== | ||
+ | [https://blog.csdn.net/weixin_43465312/article/details/99132300 Django的objects.get和objects.filter方法详解和区别] | ||
+ | == Django--makemigrations和migrate的差别== | ||
+ | [https://blog.csdn.net/Wangtuo1115/article/details/105299606 浅谈Django--makemigrations和migrate的差别] | ||
+ | |||
+ | =2021 cmdb django learn= | ||
+ | |||
+ | [https://blog.csdn.net/Wangtuo1115/article/details/106189158#t33 Python---Django项目实战:CMDB资产扫描和DevOPS自动化运维] | ||
+ | |||
+ | =trouble shouoting= | ||
+ | <pre> | ||
+ | (admin.E001) The value of 'raw_id_fields' must be a list or tuple. | ||
+ | raw_id_fields=("author" ) --raw_id_fields=("author", ) | ||
+ | |||
+ | |||
+ | jango.template.exceptions.TemplateDoesNotExist: admin/index.html | ||
+ | include(admin.site.urls)), and setting 'APP_DIRS': True, | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | UserIPInfo is not defined | ||
+ | NameError: name 'BrowseInfo' is not defined | ||
+ | |||
+ | from scanhosts.models import UserIPInfo | ||
+ | |||
+ | |||
+ | django.db.utils.DataError: (1406, "Data too long for column 'user_agent' at row 1") | ||
+ | |||
+ | mysql >SET @@global.sql_mode= ''; | ||
+ | 或者创建库时为 大utf8 | ||
+ | |||
+ | user_agent = models.CharField(max_length=100, default='',verbose_name='用户浏览器信息', null=True) | ||
+ | |||
+ | |||
+ | views.py | ||
+ | 搭建 python Django 框架时报错: 'HttpResponse' is not defined | ||
+ | |||
+ | 这里要导入: | ||
+ | |||
+ | from django.shortcuts import HttpResponse | ||
+ | |||
+ | name 'JsonResponse' is not defined | ||
+ | |||
+ | from django.http import HttpResponse,JsonResponse | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | [http://huanyouchen.github.io/2018/05/22/mysql-error-1406-Data-too-long-for-column/ mysql报错:1406, "Data too long for column] | ||
+ | |||
+ | =站内资源= | ||
+ | |||
+ | [[Cmdb]] | ||
+ | =see also= | ||
+ | [https://www.zhihu.com/question/26235428 学Python Django学得很迷茫,怎么办?] | ||
+ | |||
+ | |||
+ | [https://www.cnblogs.com/yinzhengjie/tag/Django%E5%BC%80%E5%8F%91/ Django开发 ] | ||
+ | [https://www.cnblogs.com/yinzhengjie/p/10243997.html 运维开发笔记整理-使用Django编写helloworld ] | ||
+ | |||
+ | [https://www.cnblogs.com/yinzhengjie/p/10246850.html 运维开发笔记整理-创建django用户] | ||
+ | |||
+ | [https://www.cnblogs.com/imyalost/p/8503119.html Django:安装和启动 ] |
2024年11月13日 (三) 02:25的最新版本
目录
进阶
Friday May 13 2022 django 3.2 LTS 老齐的东西
python+Django+mysql+bootstrap(前端,数据库一次搞定)从头教你毕设实现一个简易好看的仓储物资管理之类系统
https://www.cnblogs.com/bad-robot/category/1271241.html
How to use Django with Gunicorn
前端Vue结合后端DjangoFramework的在线生鲜超市(前后端分离)
用python获取股票数据、通过django用web展示_通过django搭建一个简易的web页面(实现数据的查询、添加、修改、删除)
django + vue前后端分离
Django个人博客搭建教程---用Vue写你的第一个前后端分离页面
django源码
Django authentication system 内置用户权限管理
https://docs.djangoproject.com/en/1.10/topics/auth/default/
django 注册功能
没有自带 但有很好的第三方 django-regisstration https://django-registration.readthedocs.io/en/2.0.4/install.html
API Django social auth https://github.com/omab/django-social-auth
django 视频 2024
tutorial
kali 2024 sudo pip3 install Django==1.11.1 --break-system-packages 版本查看 现在 用3.2 LTS may 2022 $ python3 -m pip install Django==2.2 python -m django --version 编辑 models.py 文件,改变模型。 运行 python manage.py makemigrations 为模型的改变生成迁移文件。 运行 python manage.py migrate 来应用数据库迁移。
tutorial2
https://docs.djangoproject.com/zh-hans/2.2/intro/tutorial03/
devops/django/djtmp/
django4
install
dj 1.10 or 1.11 应该得用docker
docker 跑django 1.10
alpine 3.12
registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:adj1.10.8v1 docker run -itd --name a110 -p8000:8000 -v /home/evan/data/github/django/project/laoqi/adj110:/root registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:adj1.10.8v1 docker exec -it a110 sh python manage.py runserver 0.0.0.0:8000 sqlite :DB Browser for SQLite or DBeaver python manage.py createsuperuser --username=evan [email protected]
ubuntu 18
cd /home/evan/data/github/django/project/laoqi/dj110 sudo code mysite --user-data-dir='.' --no-sandbox #进入docker docker pull ubuntu:18.04 docker run -itd --name ubuntu-18 ubuntu:18.04 docker exec -it ubuntu-18 /bin/bash apt update apt install python3-pip cd /root mkdir .pip echo '[global] index-url = https://mirrors.aliyun.com/pypi/simple/ format = columns [install] trusted-host=mirrors.aliyun.com ' >.pip/pip.conf pip3 install Django==1.10.1 django-admin startproject mytest #把运行中的 ubuntu 18.04 打包为image 并 push 到ali docker ps | grep ubuntu docker commit 9db9b8deb4a0 django1.10 docker tag 2e30489fdc69 registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 docker push registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10v2 #-v 数据共享 但是得sudo code docker run -itd --name dj110 -p8000:8000 -v /home/evan/data/github/django/project/laoqi/dj110:/root registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 docker run -itd --name dj110 -p8000:8000 registry.cn-hangzhou.aliyuncs.com/evan886/my_k8s_containers:django1.10 docker exec -it dj110 /bin/bash python3 manage.py runserver 0.0.0.0:8000
https://hub.docker.com/_/django
Django框架更新较为频繁,每个版本之间总是有些差异的,因此可以根据下面的python和Django匹配情况选择版本进行安装。
Django对python各版本的支持情况如下表: Django version Python version 1.8 2.7,3.3,3.4,3.5 1.9,1.10 2.7,3.4,3.5 1.11 2.7,3.4,3.5,3.6 2.0 3.5+
pi3 上安装最新版本是可以的
python3 -c "import django" sudo pip3 install Django==1.10.1 --break-system-packages
tmp django-admin startproject mysite
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 5, in <module> from django.core.management import execute_from_command_line
startproject 也不行 看来是环境问题
apt install python3-django
python3 manage.py runserver 0.0.0.0:8000
django项目中settings.py中的BASE_DIR的分析
1.__file__得到当前文件文件名字 2.os.path.abspath(file)得到当前文件的绝对路径 3.os.path.dirname(os.path.abspath(file))得到当前文件的上一层的文件夹路径 4.os.path.dirname(os.path.dirname(os.path.abspath(file)))得到当前文件的上一次文件夹的上一层文件夹路径 grep -rn BASE settings.py #当前文件的上一个目录是也 'DIRS': [os.path.join(BASE_DIR, 'templates'),],
关于django项目中settings.py中的BASE_DIR的分析
django RESTful api
Django model
依赖包到requirements.txt
项目搬迁,快捷导出环境依赖包到requirements.txt
项目搬迁的时候,需要把当前的环境依赖包导出,然后到部署项目的服务器上安装依赖。 我们可以通过下面的命令执行,把依赖包导出到requirements.txt文件里。 生成requirements.txt
pip freeze > requirements.txt
安装requirements.txt依赖
pip install -r requirements.txt
Django结合Pyecharts实现数据可视化
数据可视化图形展示pyecharts 大部分在这里啦
https://blog.csdn.net/qq_34156628/article/details/106308176
我的代码 在 https://github.com/evan886/pyecharts-learn
celery
Celery是由Python开发、简单、灵活、可靠的分布式任务队列,其本质是生产者消费者模型,生产者发送任务到消息队列,消费者负责处理任务
Celery由以下四部分构成:任务模块(Task)、消息中间件(Broker)、任务执行单元Worker、结果存储(Backend) 任务模块Task:包含异步任务和定时任务,异步任务通常在业务逻辑中被触发并发往任务队列,而定时任务由Celery Beat进程周期性的将任务发往任务队列 消息中间件Broker:即为任务调度队列,接收任务生产者发来的消息(即任务),将任务存入队列。Celery本身不提供队列服务,官方提供了很多备选方案,支持RabbitMQ、Redis、Amazon SQS等,官方推荐RabbitMQ。 任务执行单元Worker:Worker是任务执行单元,负责从消息队列中取出任务执行,它可以启动一个或者多个,也可以启动在不同的机器节点,这就是其实现分布式的核心。实时监控消息队列,获取队列中调度的任务并执行它。 结果存储Backend:用于存储任务的执行结果。官方提供了诸多的存储方式支持:RabbitMQ、 Redis、Memcached、SQLAlchemy、Django ORM、Apache Cassandra、Elasticsearch
Django中使用定时任务
如果想要在django中使用定时任务功能同样是靠beat完成任务发送功能,当在Django中使用定时任务时,需要安装django-celery-beat插件。以下将介绍使用过程。
learn
learn Django中使用Celery 讲的一样有 refu api
【good】【异步/定时任务】Django中使用Celery实现异步和定时任务 转Django+Django-Celery+Celery的整合实战
Django中使用Celery实现定时任务(用djcelery)
flower
pip install flower
Usage Examples
Launch the Flower server at specified port other than default 5555 (open the UI at http://localhost:5566):
$ celery flower --port=5566
https://flower.readthedocs.io/en/latest/install.html
相关的任务队列
Django-Q django Q 的使用方法
提高django的并发能力
常用知识
Json序列化和反序列化模块dumps、dump、loads、load功能
Json的序列化和反序列化:
序列化: 将Python对象转换为Json字符串 - - - > dumps和dump 反序列化: 将Json字符串转换为Python对象 - - - > loads和load
Json序列化和反序列化模块dumps、dump、loads、load功能介绍
Django HttpResponse与JsonResponse
Django HttpResponse与JsonResponse
Django的objects.get和objects.filter方法详解
Django的objects.get和objects.filter方法详解和区别
Django--makemigrations和migrate的差别
浅谈Django--makemigrations和migrate的差别
2021 cmdb django learn
Python---Django项目实战:CMDB资产扫描和DevOPS自动化运维
trouble shouoting
(admin.E001) The value of 'raw_id_fields' must be a list or tuple. raw_id_fields=("author" ) --raw_id_fields=("author", ) jango.template.exceptions.TemplateDoesNotExist: admin/index.html include(admin.site.urls)), and setting 'APP_DIRS': True, UserIPInfo is not defined NameError: name 'BrowseInfo' is not defined from scanhosts.models import UserIPInfo django.db.utils.DataError: (1406, "Data too long for column 'user_agent' at row 1") mysql >SET @@global.sql_mode= ''; 或者创建库时为 大utf8 user_agent = models.CharField(max_length=100, default='',verbose_name='用户浏览器信息', null=True) views.py 搭建 python Django 框架时报错: 'HttpResponse' is not defined 这里要导入: from django.shortcuts import HttpResponse name 'JsonResponse' is not defined from django.http import HttpResponse,JsonResponse
mysql报错:1406, "Data too long for column