错误:django.db.utils.OperationalError: no such column: django_celery_results_taskresult.hidden 原因:本地库版本太低了,升级 django-celery-results 就好了 (joyoo2) yinzhuoqundeMacBook-Pro:joyoo zhuoqun$ pip list | grep djan… ... continue reading django joyo 2021/12/11 322
Pycharm ModuleNotFoundError: No module named 'settings' pycharm 添加的 django 老项目,启动时报错: ModuleNotFoundError: No module named 'settings' 解决办法: django 项目 settings.py … ... continue reading django joyo 2021/12/1 466
Django admin: How to insert Inline between fields The positioning of the TabularInline, it would seem to be a simple task. Most of Django developers face this challenge … ... continue reading django joyo 2021/8/5 70
Django admin admin_order_field 自定义字段排序实现方法 模型 # admin.py class CustomerAdmin(admin.ModelAdmin): list_display = ('foo', 'number_of_orders') # model… ... continue reading django joyo 2021/5/17 447
Django import_export 按用户类型显示导入导出按钮 @admin.register(InvestProject) # class InvestProjectAdmin(admin.ModelAdmin): class InvestProjectAdmin(ImportExportA… ... continue reading django joyo 2021/4/16 404
Celery 是否需要关注任务执行状态(全局和任务函数) 是否需要关注任务执行状态,这个要视具体的业务场景来看,如果对结果不关心,或者任务的执行本身会对数据产生影响,通过对数据的判断可以知道执行的结果那就不需要返回 celery 任务的退出状态,可以在配置文件里(settings.p… ... continue reading django joyo 2021/3/4 107
Django import_export export 导出时新增自定义字段 环境 Django==2.2.x django-import-export==2.3.0 代码 from django.contrib import admin from .models import * … ... continue reading django joyo 2021/2/5 331
Django autocomplete: must define "search_fields" 错误日志 <class 'finance.admin.CapitalizedCostAdmin'>: (admin.E040) InvestProjectAdmin must define "search_field… ... continue reading django joyo 2021/1/5 122
Django import_export 个性化可视化导出外键字段 models.py class Article(models.Model): """ 主题表/文章表 """ title = models.CharField(max_length=128… ... continue reading django joyo 2020/12/9 790
Django import_export 个性化导出 model 里的 字段含有 choice 的值 models.py class UserProfile(AbstractUser): """ 用户 """ gender_choice = ( ("0", "女"), … ... continue reading django joyo 2020/12/8 599