ycd / manage-fastapi

:rocket: CLI tool for FastAPI. Generating new FastAPI projects & boilerplates made easy.
https://github.com/ycd/manage-fastapi
MIT License
1.68k stars 105 forks source link

Choice template #51

Open F0rzend opened 3 years ago

F0rzend commented 3 years ago

I want to use my own templates for project and application generation.

Kludex commented 3 years ago

Ok. How can we help here?

Kludex commented 3 years ago

Thinking about this, what we can do:

F0rzend commented 3 years ago

Thinking about this, what we can do:

  • Create a .config/manage-fastapi folder, which stores local configuration.
  • Register templates on manage-fastapi, store the path reference on the .config/manage.fastapi folder.
  • Enable a custom command on the CLI - maybe custom. To include and to create custom templates.

I think the best solution would be a directory in the system, for example ~manage_fastapi/templates, and a cli command -t, --template [template name or link (cookiecutter supports links)]

F0rzend commented 3 years ago

You also need the ability to launch a project with a custom template, eali. that uses the factory for the application. Honestly, I don't know the best way to do this.

Probably the --factory flag when generating a project using a custom template would be a good idea. but then you need to add --factory to the startup and, as it seems to me, it is better to search for the factory with the name app_factory, not app, as now for application