-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Improve error message #684
Comments
will it help if you change this:
to this:
|
well that'l looks like the issue - there might be some re-import loop that leads to a so I would suggest trying to use direct imports instead of includes (and a bunch of |
I understand your response. I will report after i refractor my code. Thanks again for fast response i dont have the bandwidth to debug this issue right now |
Debugging this: @vitalik I may have found the error causing line. Would you mind sharing your use case as to why you wrote this ? With this line :Poe => python ./django_core/manage.py runserver 127.0.0.1:9000
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 475, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 42, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 61, in _load_all_namespaces
url_patterns = getattr(resolver, "url_patterns", [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/core/urls.py", line 55, in <module>
path("api/", include("apps.api.urls")),
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/urls.py", line 20, in <module>
api.add_router(
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/main.py", line 367, in add_router
self._routers.extend(router.build_routers(prefix))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/router.py", line 366, in build_routers
raise ConfigError(
ninja.errors.ConfigError: Router@'/anime' has already been attached to API CoreProjectAPI:1.0.0 Without this line :Poe => python ./django_core/manage.py runserver 127.0.0.1:9000
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 475, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 42, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 61, in _load_all_namespaces
url_patterns = getattr(resolver, "url_patterns", [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/core/urls.py", line 55, in <module>
path("api/", include("apps.api.urls")),
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/urls.py", line 20, in <module>
api.add_router(
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/main.py", line 367, in add_router
self._routers.extend(router.build_routers(prefix))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/router.py", line 366, in build_routers
raise ConfigError(
ninja.errors.ConfigError: Router@'/anime' has already been attached to API CoreProjectAPI:1.0.0
/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/router.py changed, reloading.
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 475, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 42, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 61, in _load_all_namespaces
url_patterns = getattr(resolver, "url_patterns", [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/core/urls.py", line 55, in <module>
path("api/", include("apps.api.urls")),
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/urls.py", line 225, in <module>
from .views.feeds.featured import router as feature_router
File "/home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/views/feeds/featured.py", line 12, in <module>
@router.get("/", response=list[AnimeInfoGETSchema], auth=AuthBearer(), fi=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Router.get() got an unexpected keyword argument 'fi' |
@baseplate-admin not sure I understand the issue here
|
Alright lets start from beginning : Lets say you have this code ( which is incorrect ) : @router.get("/", response=UserSchema, auth=AuthBearer(),fi=True) # Note that fi=True is not a valid argument.
def get_user_info(request: HttpRequest) -> CustomUser:
user = CustomUser.objects.get(pk=request.auth.id)
return user The error message i get when i run django dev server is : /home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/views/user/__init__.py changed, reloading.
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run
self.check(display_num_errors=True)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/core/urls.py", line 55, in <module>
path("api/", include("apps.api.urls")),
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/urls.py", line 20, in <module>
api.add_router(
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/main.py", line 367, in add_router
self._routers.extend(router.build_routers(prefix))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/router.py", line 366, in build_routers
raise ConfigError(
ninja.errors.ConfigError: Router@'/anime' has already been attached to API CoreProjectAPI:1.0.0 Which doesn't tell me where the error is. But if i remove this code the error message becomes : /home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/ninja/router.py changed, reloading.
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run
self.check(display_num_errors=True)
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/core/urls.py", line 55, in <module>
path("api/", include("apps.api.urls")),
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.cache/pypoetry/virtualenvs/coreproject-8--vJVvO-py3.11/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/baseplate-admin/.pyenv/versions/3.11.2/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/urls.py", line 159, in <module>
from .views.user import router as user_router
File "/home/baseplate-admin/programming/coreproject/backend/django_core/apps/api/views/user/__init__.py", line 15, in <module>
@router.get("/", response=UserSchema, auth=AuthBearer(),fi=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Router.get() got an unexpected keyword argument 'fi' Here is a video showing what i mean. |
Note (for myself) the part that removed: Lines 362 to 369 in 6ed724e
|
Hey @vitalik , See this : #623 (comment) I think this line is also causing performance errors in other places. |
Hi @vitalik, I know you been busy with |
HI, Is there any update on this? |
This issue seems to be resolved. Closing |
Hi there, Thanks for making this library. But this library has a major problem ( in my opinion )
Is your feature request related to a problem? Please describe.
Lets take an example of my project
Then see this video
Whenever i modify this line
django-ninja
throws an error named :ninja.errors.ConfigError: Router@'/anime' has already been attached to API CoreProjectAPI:1.0.0
But this error is not related to my
django-ninja
code.Describe the solution you'd like
Please improve the error reporting by
django-ninja
Thanks a bunch
The text was updated successfully, but these errors were encountered: