Comments (11)
@tiangolo right now FastAPI is still not as productive as Django Rest Framework because of the lack of user-registration/management workflow. The generator is nice but it's too tightly coupled. Would be nice to have a proper CRUD generator/admin story. You mentioned not wanting to include a ORM but without one a lot of time is wasted on shipping CRUD code, fiddling with migrations etc. If nothing, at least include Django's ORM to make life easier.
ref: https://www.reddit.com/r/Python/comments/b0zxa9/introducing_fastapi/eikicdj/
from fastapi.
Hey @tiangolo I'd be glad to start working on this. I might make a proof of concept in the following weeks, is there any specific functionality you'd be looking for?
The way I see it rendering the following input types would be enough for a POC:
- string
- number
- date
- choices(enum)
- foreign key (with a link to the resource)
What do you think? would that help? Also, I am planning to use vuetify for this if that is ok.
from fastapi.
Recommend my admin dashboard fastapi-admin,based on fastapi and tortoise-orm and rest-admin,hope a star~😁
from fastapi.
I don't like the idea on an ORM being incorporated into a project like this, what makes fastapi great IMO is it's focus on doing what it does extremely well. Async python routing with strict typing, and openapi generation. The docs detail how to incorporate an ORM. It would totally be cool to see some kind of vue frontend rendered from the OpenAPI with knowledge of the Pydantic models they come from for sure.
from fastapi.
Thanks, yes, I've been thinking about this (I think we discussed it on Linkedin). I plan on building a Vue.js CRUD admin for OpenAPI.
It would not be tightly coupled to FastAPI, as it would be compatible with OpenAPI in general, but would be made to be easily added/pluggable as the current docs pages.
I have to first build the pieces, Vue components that render correctly data to be viewed in a "details" section (for one item), in list (for multiple items), and edition mode. And then, automatic sections based on tags. And then, I have to see how to solve handling the relationships between different models/schemas. I also have to see how to integrate it with security. I already have OAuth2 with password scheme (that's already in the project generators), but maybe that can be generalizable to other schemes.
from fastapi.
I am also interested at building a admin. I'd like to use fastapi, mongodb, vue and vuetify. And I want to have a RBAC authentication too. But I'am not an experienced programmer.
I need some advice / best practice about how to implement those. Especially:
-
automatic sections based on tags
@tiangolo Can you share your idea about how to implement it? Should I just read and parsehttp://127.0.0.1:8000/openapi.json
by hand or is there any great npm package to do it? -
How to implement RBAC for FastApi?
What represent the permission?
For example,@app.put("/items/{item_id}", response_model=Item) async def update_item(item_id: str, item: Item): update_item_encoded = jsonable_encoder(item) items[item_id] = update_item_encoded return update_item_encoded
What will be the permission name? How to identify it with code?
Should I use FastAPI's dependency system to verify role and permission? -
I use mongoengine to create model and create event handlers to connect and disconnect multiple connection from the mongodb(
@app.on_event("startup")
,@app.on_event("shutdown")
) (refer the document)
I wish there a tutorial about how to use mongoengine with FastAPI.
@jlugao Can you share your work of crud with vue?
Edit: I make some progress to implement. Although I'm not very confident about the code I write, I just make it public here: https://github.com/shizidushu/simple-report-data-table-vuetify
from fastapi.
I'd suggest that https://github.com/awtkns/fastapi-crudrouter meets this need so would agree with closing the issue.
from fastapi.
I know TypeSystem can do form rendering
https://www.encode.io/typesystem/forms/
I wonder if this can be achieved with pydantic
from fastapi.
@tiangolo suggestion to close this issue. This would be pretty awesome, but probably a whole new project, and eventually not part of the FastAPI core code.
from fastapi.
Hello everyone! As several have pointed out, this would actually be an independent project. If it's just based on OpenAPI, it would be a new frontend. If it's also dependent on the database, it would also depend on a specific type of database (e.g. SQL or NoSQL) and ORM, so again, another project.
The idea is of course still valid, and some of the projects mentioned here can do a great job. But to keep issues clean, and because this would really belong in an external project(s), I'm gonna close this one now. Thanks for all the interactions and discussion!
Sorry for the long delay! 🙈 I wanted to personally address each issue and they piled up through time, but now I'm checking each one in order.
from fastapi.
Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs.
from fastapi.
Related Issues (20)
- No streaming interface can not support concurrency for two fastapi servers
- Using pydantic Json Type as Form data type doesn't work HOT 1
- Raw docstring (leading `r`) defeats form feed `\f` truncation HOT 3
- OpenAPI Example with multipart/form-data not showing up HOT 5
- [BUG] Using Nested Pydantic models and `params: MyModel = Depends()` forces OpenAPI docs GET methods to require a request body. HOT 6
- How to fix this bug? HOT 2
- [BUG] Upgrade python-mulipart==0.0.7 from low version fastapi upload file may be 400 HOT 4
- Use `RootModel` as query parameter HOT 2
- Context managers in `Depends` are broken after 0.106 HOT 16
- Middleware runs twice HOT 8
- Support for Pydantic deprecated fields HOT 1
- axios can't receive error response status code
- Potential footgun when using custom `Response(background=<Task()>)` in conjunction with injected `BackgroundTasks` - the custom response overwrites the tasks HOT 3
- lifespan
- Breaking change with path parameters when updating to pydantic>=2 from pydantic<2 HOT 1
- trying to live video stream using Fastapi
- Package on test.pypi.org is broken
- middleware type
- It throws an exception when I specify return Http status code
- When backend restart the frontend request a protected api cause an unhandle exception: Exception in ASGI application HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastapi.