https://stackoverflow.com/questions/852414/how-to-dynamically-compose-an-or-query-filter-in-django
Use absolute imports for other Django components and relative imports for local components.
入口是manage.py:django.core.management.execute_from_command_line,然后调用django.core.management.ManagementUtility
的execute方法,所以:是ManagementUtility
控制命令调用行为,在ManagementUtility类中python manage.py 就已经调用execute方法获取命令传递的settings的值的并通过django.setup()初始化了, 然后再通过self.fetch_command(subcommand).run_from_argv(self.argv)
执行子命令, 所以在自定义命令BaseCommand里面更改setting配置的默认值并没有生效.
解决办法: 修改manage.py入口,更改setting路径