Olá. Após instalar a dependência do django-filter e tentar subir o projeto com o comando "python manage.py runserver"o seguinte erro aparece:
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run
self.check(display_num_errors=True)
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
^^^^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/setup/urls.py", line 3, in <module>
from rest_framework import routers
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/rest_framework/routers.py", line 19, in <module>
from django.conf.urls import url
ImportError: cannot import name 'url' from 'django.conf.urls' (/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/conf/urls/__init__.py)
Traceback (most recent call last):
File "/Users/raphaelpfeifer/projetos/python-apis/projeto_clientes/venv/lib/python3.12/site-packages/django/template/utils.py", line 69, in __getitem__
return self._engines[alias]
~~~~~~~~~~~~~^^^^^^^
KeyError: 'django'