This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: router error due to already existed basename
Exception in thread django-main-thread: 2024-04-15 14:56:18 Traceback (most recent call last): 2024-04-15 14:56:18 File "/opt/pyenv/versions/3.12.2/lib/python3.12/threading.py", line 1073, in _bootstrap_inner 2024-04-15 14:56:18 self.run() 2024-04-15 14:56:18 File "/opt/pyenv/versions/3.12.2/lib/python3.12/threading.py", line 1010, in run 2024-04-15 14:56:18 self._target(*self._args, **self._kwargs) 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/utils/autoreload.py", line 64, in wrapper 2024-04-15 14:56:18 fn(*args, **kwargs) 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/core/management/commands/runserver.py", line 118, in inner_run 2024-04-15 14:56:18 self.check(display_num_errors=True) 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/core/management/base.py", line 419, in check 2024-04-15 14:56:18 all_issues = checks.run_checks( 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/core/checks/registry.py", line 76, in run_checks 2024-04-15 14:56:18 new_errors = check(app_configs=app_configs, databases=databases) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 13, in check_url_config 2024-04-15 14:56:18 return check_resolver(resolver) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 23, in check_resolver 2024-04-15 14:56:18 return check_method() 2024-04-15 14:56:18 ^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 416, in check 2024-04-15 14:56:18 for pattern in self.url_patterns: 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/utils/functional.py", line 48, in __get__ 2024-04-15 14:56:18 res = instance.__dict__[self.name] = self.func(instance) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 602, in url_patterns 2024-04-15 14:56:18 patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/utils/functional.py", line 48, in __get__ 2024-04-15 14:56:18 res = instance.__dict__[self.name] = self.func(instance) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 595, in urlconf_module 2024-04-15 14:56:18 return import_module(self.urlconf_name) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/opt/pyenv/versions/3.12.2/lib/python3.12/importlib/__init__.py", line 90, in import_module 2024-04-15 14:56:18 return _bootstrap._gcd_import(name[level:], package, level) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "<frozen importlib._bootstrap>", line 1387, in _gcd_import 2024-04-15 14:56:18 File "<frozen importlib._bootstrap>", line 1360, in _find_and_load 2024-04-15 14:56:18 File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked 2024-04-15 14:56:18 File "<frozen importlib._bootstrap>", line 935, in _load_unlocked 2024-04-15 14:56:18 File "<frozen importlib._bootstrap_external>", line 995, in exec_module 2024-04-15 14:56:18 File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed 2024-04-15 14:56:18 File "/openedx/ecommerce/ecommerce/urls.py", line 23, in <module> 2024-04-15 14:56:18 from ecommerce.extensions.urls import urlpatterns as extensions_patterns 2024-04-15 14:56:18 File "/openedx/ecommerce/ecommerce/extensions/urls.py", line 11, in <module> 2024-04-15 14:56:18 url(r'^api/', include(('ecommerce.extensions.api.urls', 'api'))), 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/urls/conf.py", line 34, in include 2024-04-15 14:56:18 urlconf_module = import_module(urlconf_module) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/opt/pyenv/versions/3.12.2/lib/python3.12/importlib/__init__.py", line 90, in import_module 2024-04-15 14:56:18 return _bootstrap._gcd_import(name[level:], package, level) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/ecommerce/ecommerce/extensions/api/urls.py", line 6, in <module> 2024-04-15 14:56:18 url(r'^v2/', include(('ecommerce.extensions.api.v2.urls', 'v2'))), 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/django/urls/conf.py", line 34, in include 2024-04-15 14:56:18 urlconf_module = import_module(urlconf_module) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/opt/pyenv/versions/3.12.2/lib/python3.12/importlib/__init__.py", line 90, in import_module 2024-04-15 14:56:18 return _bootstrap._gcd_import(name[level:], package, level) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/ecommerce/ecommerce/extensions/api/v2/urls.py", line 175, in <module> 2024-04-15 14:56:18 router.register(r'partners', partner_views.PartnerViewSet, basename='partner') \ 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/rest_framework_extensions/routers.py", line 57, in register 2024-04-15 14:56:18 self._register(*args, **kwargs) 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/rest_framework_extensions/routers.py", line 54, in _register 2024-04-15 14:56:18 return super().register(*args, **kwargs) 2024-04-15 14:56:18 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-04-15 14:56:18 File "/openedx/venv/lib/python3.12/site-packages/rest_framework/routers.py", line 59, in register 2024-04-15 14:56:18 raise ImproperlyConfigured(msg) 2024-04-15 14:56:18 django.core.exceptions.ImproperlyConfigured: Router with basename "partner" is already registered. Please provide a unique basename for viewset "<class 'ecommerce.extensions.api.v2.views.partners.PartnerViewSet'>"
- Loading branch information