Skip to content

list index out of range Error when getting module names on app init #15

@tyanas

Description

@tyanas

model, app_module.name.split(".")[1]

Stack trace

# 2024-08-14 17:25:22   File "/usr/local/lib/python3.12/site-packages/easy/main.py", line 99, in auto_create_admin_controllers
# 2024-08-14 17:25:22     model, app_module.name.split(".")[1]
# 2024-08-14 17:25:22            ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
# 2024-08-14 17:25:22 IndexError: list index out of range

requirements.txt

Django=5.0.1
...
django-api-framework==0.2.0 # easy BUGS

Context: python manage.py shell

>>> from django.apps import apps
>>> items = apps.app_configs.items()
>>> [x[0] for x in items]
['admin', 'auth', 'contenttypes', 'sessions', 'messages', 'staticfiles', 'allauth', '...,'rest_framework', 'users',...]

A possible solution would be to use app_module[0] instead of app_module.name.split(".")[1] in easy/main.py#L99

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions