Django中的管理文件夹除命令之外还有什么用途? [英] Are there any purposes for the management folder in Django other than commands?

查看:126
本文介绍了Django中的管理文件夹除命令之外还有什么用途?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么管理命令不在自己的应用级文件夹中?有没有可以添加到管理目录中的其他项目,或者这个结构是否纯粹是残留的?

解决方案

另一件需要放在管理模块中(在 management / __ init __。py manage.py )是 django.db.models.signals.post_sync 信号的任何监听器。


Why are management commands not in their own app-level folder? Are there other items which can be added to the management directory or is this structure purely vestigial?

解决方案

Another thing that needs to be placed in the management module (either in management/__init__.py or management.py) is any listeners to the django.db.models.signals.post_sync signal.

这篇关于Django中的管理文件夹除命令之外还有什么用途?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆