allient / create-fastapi-project

CLI to create Fastapi projects easily.
https://pypi.org/project/create-fastapi-project
MIT License
80 stars 10 forks source link

Makefile:1: *** missing separator. stop. error. #2

Closed irfanmuratgoc closed 11 months ago

irfanmuratgoc commented 11 months ago

Cannot run make command after successful project creation Makefile:1: *** missing separator. stop. error.

irfanmuratgoc commented 11 months ago

run poetry install on app and run poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 The command reports the following error

% poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 Traceback (most recent call last): File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/bin/uvicorn", line 8, in sys.exit(main()) File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, **kwargs) File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 416, in main run( File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 587, in run server.run() File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 68, in serve config.load() File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/uvicorn/config.py", line 467, in load self.loaded_app = import_from_string(self.app) File "/Users/yefan/Library/Caches/pypoetry/virtualenvs/app-_3Y3QYCI-py3.10/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/Users/yefan/development/AI/allm/backend/backend/app/app/main.py", line 3, in from app.api.v1.api import api_router as api_router_v1 File "/Users/yefan/development/AI/allm/backend/backend/app/app/api/v1/api.py", line 2, in from app.api.v1.endpoints import ( File "/Users/yefan/development/AI/allm/backend/backend/app/app/api/v1/endpoints/chat.py", line 1, in from app.core.config import settings File "/Users/yefan/development/AI/allm/backend/backend/app/app/core/config.py", line 27, in settings = Settings() File "pydantic/env_settings.py", line 40, in pydantic.env_settings.BaseSettings.init File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 4 validation errors for Settings BACKEND_CORS_ORIGINS field required (type=value_error.missing) OPENAI_API_KEY field required (type=value_error.missing) UNSPLASH_API_KEY field required (type=value_error.missing) SERP_API_KEY field required (type=value_error.missing)

jonra1993 commented 11 months ago

Hello @irfanmuratgoc I am sorry for the late response. Can you please let me know that after the project is created it generates .env file like this

image

Can you check which version you have with this command: pip show fastapi-create-project

The latest one is 0.2.3

If it is not the latest you can upgrade with this command

pip install --upgrade package-name