django collectstatic 'AppConfig' 对象没有属性 'ignore_patterns'

django collectstatic 'AppConfig' object has no attribute 'ignore_patterns'

我最近将 django 升级到 3.2.5,之后管理模板无法正确加载,尤其是在模型页面中,请看截图,

我决定运行,

python manage.py collectstatic

但我收到以下错误

Traceback (most recent call last): File "/var/www/dev.bluelion.icu/bluelion/manage.py", line 21, in main() File "/var/www/dev.bluelion.icu/bluelion/manage.py", line 17, in main execute_from_command_line(sys.argv) File "/var/www/dev.bluelion.icu/bluelion/bluelionenv/lib/python3.9/site-packages/django/core/management/init.py", line 419, in execute_from_command_line utility.execute() File "/var/www/dev.bluelion.icu/bluelion/bluelionenv/lib/python3.9/site-packages/django/core/management/init.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/var/www/dev.bluelion.icu/bluelion/bluelionenv/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/var/www/dev.bluelion.icu/bluelion/bluelionenv/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/var/www/dev.bluelion.icu/bluelion/bluelionenv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 149, in handle self.set_options(**options) File "/var/www/dev.bluelion.icu/bluelion/bluelionenv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 82, in set_options ignore_patterns += apps.get_app_config('staticfiles').ignore_patterns AttributeError: 'AppConfig' object has no attribute 'ignore_patterns'

感谢任何帮助,如果问题中有任何歧义,请告诉我!

对我来说,就是这行代码:AppConfig.default = False

我添加它是因为它修复了不同的错误消息。但是当我 运行 collectstatic 它告诉我你的错误。