Tentei acompanhar o projeto e foi tudo bem até o capítulo 3. Quando começou a parte de frontend , mesmo no primeiro teste quando tentava o http://localhost:8000/ já dava erro. (Internal Error ) Se tentasse o endereço com '/clientes' devolvia o json ok, mas a parte de frontend não funcionava. Não consegui entender e não pude mais acompanhar pelo meu projeto.
No final do curso, peguei o codigo no github e tentei usar o docker (fiz build e depois mandei executar):
docker run --rm -p 8080:8000 techlog:v1
Mas ao testar no browser recebi o mesmo erro no endereço //localhost:8080 : Internal error.
Não consigo colocar todo log, vou colocar o começo do log e o finalzinho dele
(Parte inicial do log:)
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Banco de dados inicializado
INFO: 172.18.0.1:50020 - "GET / HTTP/1.1" 303 See Other
INFO: 172.18.0.1:50020 - "GET /login HTTP/1.1" 307 Temporary Redirect
INFO: 172.18.0.1:50020 - "GET /login/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/uvicorn/protocols/http/httptools_impl.py", line 421, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.scope, self.receive, self.send
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/uvicorn/middleware/proxy_headers.py", line 56, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/fastapi/applications.py", line 1159, in call
await super().call(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/applications.py", line 90, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/base.py", line 191, in call
with recv_stream, send_stream, collapse_excgroups():
~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/contextlib.py", line 162, in exit
self.gen.throw(value)
~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
raise exc
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/base.py", line 193, in call
response = await self.dispatch_func(request, call_next)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/app/autenticacao_middleware.py", line 11, in dispatch
return await call_next(request)
^^^^^^^^^^^^^^^^^^^^^^^^
(...)
(parte final do log)
(...)
File "/usr/local/lib/python3.14/site-packages/starlette/templating.py", line 148, in TemplateResponse
template = self.get_template(name)
File "/usr/local/lib/python3.14/site-packages/starlette/templating.py", line 115, in get_template
return self.env.get_template(name)
~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.14/site-packages/jinja2/environment.py", line 1016, in get_template
return self._load_template(name, globals)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/jinja2/environment.py", line 964, in _load_template
template = self.cache.get(cache_key)
File "/usr/local/lib/python3.14/site-packages/jinja2/utils.py", line 477, in get
return self[key]
~~~~^^^^^
File "/usr/local/lib/python3.14/site-packages/jinja2/utils.py", line 515, in getitem
rv = self._mapping[key]
~~~~~~~~~~~~~^^^^^
TypeError: cannot use 'tuple' as a dict key (unhashable type: 'dict')
Poderia me ajudar? grata!