deta / cloud-docs

old docs. visit space docs instead:
https://github.com/deta/space-docs
Creative Commons Attribution 4.0 International
178 stars 68 forks source link

No entrypoint file found && failed to create new program: No such project #695

Closed serdarakyol closed 1 year ago

serdarakyol commented 1 year ago

Hello, I just discovered DETA. I was trying to follow the FastAPI documentation. Created an account, installed deta cli, and login successfully. But I failed on the deta new command. I had 2 situation

First situation

I have the folder structure as below

image

When I run deta new, I got No entrypoint file found in '/path/sabiduria-tool'. Please, provide a name or path to create a new micro elsewhere. See "deta new --help".' error.

Second situation

Changed folder structure as below

image

And got this error: Error: failed to create new program: No such project

Here is my main file

from fastapi import FastAPI

from sabiduria_tool_api.core.config import API_PREFIX, APP_NAME, APP_VERSION, IS_DEBUG
from sabiduria_tool_api.core.event_handler import start_app_handler, stop_app_handler
from sabiduria_tool_api.api.routes.router_sabiduria_tool import router

def get_app() -> FastAPI:
    fast_app = FastAPI(title=APP_NAME, version=APP_VERSION, debug=IS_DEBUG)
    fast_app.include_router(router, prefix=API_PREFIX)

    fast_app.add_event_handler("startup", start_app_handler(fast_app))
    fast_app.add_event_handler("shutdown", stop_app_handler(fast_app))

    return fast_app

app = get_app()

I used the app variable as the documentation mentioned. Can anyone tell me what is wrong here, please?