2

I recently upgraded django to 3.2.5, after which admin template was not loading correctly especially in model pages, please see the screenshot,

Django Admin model page

I decided to run,

python manage.py collectstatic

but then I am receiving following error

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'

Any help is appreciated, please let me know if there is any ambiguity in the question!

muniryasir
  • 109
  • 1
  • 8

1 Answers1

2

For me, it was this line of code: AppConfig.default = False

I added it because it fixed a different error message. But when I ran collectstatic it showed me your error.

2567910
  • 144
  • 5
  • 2
    What is workaround for this. If I remove this line (AppConfig.default = False) it starts showing other error message. – Waqas Ali Sep 20 '21 at 14:18
  • 1
    @WaqasAli In my case, the error message was caused by the wrong identifier in my apps.py. I was setting a name of an app inside a folder. Like this: inside django-app-name/blog-app/apps.py `class BlogAppConfig(AppConfig): name = 'blog-app' ` I fixed the error by changing the name to: `name = 'django-app-name.blog-app'` – 2567910 Sep 21 '21 at 14:37