MushroomMaula / fastapi_login

FastAPI-Login tries to provide similar functionality as Flask-Login does.
https://pypi.org/project/fastapi-login
MIT License
639 stars 58 forks source link

Fix some bug in the example/full-example #100

Closed tdzz1102 closed 1 year ago

tdzz1102 commented 1 year ago

I added the command python main.py create-db to README which I find by doing python main.py -h. Without doing this, python main.py create-admin <username> <password> will throw a "table not exist" bug. I also setted a default value to secret. Settings.secret is a non-optional argument. When you run python main.py create-secret at first, because ".env" file doesn't exist yet, python can't find a initial value for it and throws an error. After doing python main.py create-secret, a ".env" file containing the secret are created and will be loaded first, so the default value will not effect anything else.

MushroomMaula commented 1 year ago

Thanks for spotting the missing documentation on the create-db command. Regarding the issue when running create-secret, this should not happen. python-dotenv returns an empty string in the case that the file does not exist. Do you remember which error was thrown?