Closed andcarnivorous closed 1 year ago
Hi and thanks for your work! Instead of writing in docs that it works only with SQLAlchemy, please define is_hidden property.
Like this:
is_hidden=check_orm(['sqlalchemy'])
After you do this, this entry will only show up if the chosen orm is SQLAlchemy.
As I see, you added all possible backends and it's really great. But the problem is that every time people choose an option to add users, they need to delete many lines. I suggest you a solution. You can add new menu if users are enabled.
This would be a multiselect menu with options like:
I can help implementing it. Or you can do it yourself.
I can help implementing it. Or you can do it yourself.
@s3rius I can work on it no problem. I'll address the other points as well. Do you prefer single atomic commits on PR's?
Hi, @andcarnivorous, you can do as you want. I'll sqash commits when it's merged.
I have removed the google oauth stuff for now. Maybe I'll open another PR for that in the future just for it
@andcarnivorous, thank you. Please tell me when the PR is ready for another review.
any updates with this?
any updates with this?
Hey, really sorry, it's been a year busier than expected and completely forgot about this PR, I'll try to update it and finalize it in the following days! Sorry for forgetting about this
I have opted for skipping the users module from mypy checks, the others seem to be mypy compliant and everything is fine with flake8. The reason for skipping the mypy checks in the users.py module is that fastapi-users provides classes that inherit from Generics and it seems to be a pain to manage to make them mypy compliant so far (never found myself having to deal with this type of thing, so if anyone knows how to approach this the right way please do).
How can I test this out?
- clone the repo
- git checkout andcarnivorous:master
- something something to execute fastapi_template
- enable
users
option during interactive setupotherwise LGTM
@s3rius @andcarnivorous
How can I test this out?
1. clone the repo 2. git checkout andcarnivorous:master 3. something something to execute fastapi_template 4. enable `users` option during interactive setup
otherwise LGTM
You have to:
git clone https://github.com/andcarnivorous/FastAPI-template
)python -m pip install .
in the root of the repo.python3 -m fastapi_template
Add fastapi-users support
in the additional tweaks
section.@andcarnivorous, I truly grateful for your work. You've put so much effort into this. It's really hard to extend such templators.
Thank you very very much.
@andcarnivorous, I truly grateful for your work. You've put so much effort into this. It's really hard to extend such templators.
Thank you very very much.
No problem! It was fun and glad it could contribute.
Adds support to fastapi-users by adding the option to the menu and creating views for JWT, cookie and OAuth authentication. Adds user models and views. This is only compatible with SQLAlchemy.
Tested locally and users can be registered and log in works.