Forums

ASGI Site: Fast API Web Framework- Directory Issue?

The current ASGI documentation was helpful in successfully creating a Fast API web app. Unfortunately, I tried utilizing a directory NOT named "my_fastapi", and I received the following uvicorn error:

Error: Got unexpected extra argument (main:app)

Is this expected? I figured I could change the directory location in bold to any desired naming.

/home/YOURUSERNAME/.virtualenvs/my_venv/bin/uvicorn --app-dir /home/YOURUSERNAME/my_fastapi --uds ${DOMAIN_SOCKET} main:app

Could you show the full command you used when you got that error?

Sure, see below:

pa website create --domain www.rootsuncorked.com --command '/home/bermudatry/.virtualenvs/rootsuncorked_venv/bin/uvicorn --app-dir /home/bermudatry/rootsuncorked --uds ${DOMAIN_SOCKET} main:app'

Is it possible that you accidentally left a space in the path -- that is, something like this:

/home/bermudatry/ rootsuncorked

...? That would, I think, give you the error message that you saw.

I deleted the web app and retried the creation command, and it's now working. Not sure, if I had a typo or not but thanks for looking into my issue.

Glad to hear it's working now.