fastapi-webstarter-demo icon indicating copy to clipboard operation
fastapi-webstarter-demo copied to clipboard

Error NameError: name 'create_workspace' is not defined

Open gnurtcouq opened this issue 3 years ago • 5 comments

Hi Shinokada, I completed you codes but when trying upload a file, there is error:

... INFO: 219.74.109.137:0 - "POST /upload/new/ HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/uvicorn/protocols/http/h11_impl.py", line 394, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/local/lib/python3.7/dist-packages/uvicorn/middleware/proxy_headers.py", line 45, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/fastapi/applications.py", line 190, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/applications.py", line 111, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/middleware/errors.py", line 181, in call raise exc from None File "/usr/local/lib/python3.7/dist-packages/starlette/middleware/errors.py", line 159, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.7/dist-packages/starlette/exceptions.py", line 82, in call raise exc from None File "/usr/local/lib/python3.7/dist-packages/starlette/exceptions.py", line 71, in call await self.app(scope, receive, sender) File "/usr/local/lib/python3.7/dist-packages/starlette/routing.py", line 566, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/routing.py", line 227, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/routing.py", line 41, in app response = await func(request) File "/usr/local/lib/python3.7/dist-packages/fastapi/routing.py", line 189, in app dependant=dependant, values=values, is_coroutine=is_coroutine File "/usr/local/lib/python3.7/dist-packages/fastapi/routing.py", line 135, in run_endpoint_function return await dependant.call(**values) File "/content/fastapi-web-starter/app/routers/upload.py", line 24, in post_upload workspace = create_workspace() NameError: name 'create_workspace' is not defined

gnurtcouq avatar Aug 11 '21 09:08 gnurtcouq

You need Python 3.8.6. Please see the runtime.txt. And let me know.

shinokada avatar Aug 11 '21 09:08 shinokada

I'm using Colab with Python 3.6. 9. Is this issue?

gnurtcouq avatar Aug 11 '21 09:08 gnurtcouq

It can be. Please try to install 3.8.6. And let me know. I will update FastAPI and dependencies sometime soon.

On Wed, Aug 11, 2021 at 18:49 gnurtcouq @.***> wrote:

I'm using Colab with Python 3.6. 9. Is this issue?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/shinokada/fastapi-drag-and-drop/issues/4#issuecomment-896680348, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABD66FUTMMYEAKKFVB6B3TT4JBTRANCNFSM5B56SVRQ .

-- Shinichi Okada Math Teacher Secondary School Canadian Academy

4-1 Koyo-cho Naka Higashinada-ku, Kobe 658-0032 ph: +81 78 857 0100 (int) or 078 857 0100 (Japan)

shinokada avatar Aug 11 '21 09:08 shinokada

Hi Shinokada, Colab does not allow me t upgrade to Python 3.8.6.. The latest version of Colab is using Python 3.7.11. Can you let me know when you release FastAPI can run on Python 3.7.11 . Thank a lot

gnurtcouq avatar Aug 11 '21 10:08 gnurtcouq

Hi Shinokada, after upgrade to the latest version of Python (3.9). The codes are working perfectly.

If I want to change the codes so it can download sound file (e.g.*.wav), how can I achieve this?

Thx a lot for your help.

gnurtcouq avatar Aug 13 '21 03:08 gnurtcouq