Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tyanas opened this issue Aug 15, 2024 · 0 comments
Open

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

tyanas opened this issue Aug 15, 2024 · 0 comments

Comments

@tyanas
Copy link

tyanas commented Aug 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant