Opened 4 years ago

Last modified 4 years ago

#31870 closed Bug

App with default_app_config in init crashes — at Initial Version

Reported by: Iuri de Silvio Owned by: nobody
Component: Core (Other) Version: dev
Severity: Release blocker Keywords:
Cc: Aymeric Augustin Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If I don't have an apps.py and the default_app_config is in __init__.py, it fails.

Traceback (most recent call last):
  File "./manage.py", line 22, in <module>
    main()
  File "./manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "django/apps/config.py", line 157, in create
    if new_entry == app_config_name:
UnboundLocalError: local variable 'app_config_name' referenced before assignment

Looks like a regression added in https://code.djangoproject.com/ticket/31180.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top