Quando eu rodo esse codigo, ele da erro:
from django.contrib import admin from django.urls import path, include
urlpatterns = [ path('admin/', admin.site.urls), path('', include('galeria.urls')), ]
Já tentei reiniciar o servidor e o erro continua o mesmo, por exemplo:
Exception in thread django-main-thread: Traceback (most recent call last): File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/urls/resolvers.py", line 740, in url_patterns iter(patterns) TypeError: 'module' object is not iterable
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run self.check(display_num_errors=True) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/core/management/base.py", line 486, in check all_issues = checks.run_checks( File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/core/checks/urls.py", line 42, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/core/checks/urls.py", line 72, in _load_all_namespaces namespaces.extend(_load_all_namespaces(pattern, current)) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/core/checks/urls.py", line 61, in _load_all_namespaces url_patterns = getattr(resolver, "url_patterns", []) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/utils/functional.py", line 47, in get res = instance.dict[self.name] = self.func(instance) File "/Users/macbook/Documents/Django Alura/venv/lib/python3.10/site-packages/django/urls/resolvers.py", line 748, in url_patterns raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'galeria.urls' from '/Users/macbook/Documents/Django Alura/galeria/urls.py'>' does not appear to have any patterns in it. If you see the 'urlpatterns' variable with valid patterns in the file then the issue is probably caused by a circular import.
Link do repositorio do GitHub: https://github.com/mch-gih/Alura_space/tree/main/setup