FastAPI

FastAPI

Application and Data / Languages & Frameworks / Microframeworks (Backend)
Needs advice
on
AstroAstroSvelteKitSvelteKit
and
Vue.jsVue.js

Hello everybody! I want to create an easy to use website (and simplified) builder. Users create a site, add their domain and edit Pages inside an Admin Area inside predefined "Blocks" like with Wagtail.

There should be several default templates/themes and layouts. Choosing a different theme might change both the layout and styling. And I'm looking for SSR or SSG with a focus on the end-user's Page performance.

Current Stack:

  • GraphQL for the dynamic part (for example data to Pricing might not be required on the homepage, or images might go into gallery in one theme, and on the homepage in another theme)

  • FastAPI and SQLAlchemy to store Data. I have prior experience with Wagtail and Django and want to stay with Python and learn Fastapi

  • NGINX to handle domain-specific things (the how is not yet refined)

I want a scalable architecture and especially a fast frontend. I'm tending to use SvelteKit, but I'm afraid that the dynamic part won't make me happy after having hundreds of sites, as the bundler cannot load themes dynamically. sveltekit - dynamic import

I want to handle the scenario: Admin-User chooses a theme and other options for the site (domain) and the End-User Frontend/Session/Cookie will have to fetch and store data about the theme and load subsequent calls to prerendered sites.

Also the "hundreds of sites" might not be all covered by 5 Themes, because users may purchase a custom-made theme, and I would have to manage one big project having lots of different Styleguides and flows. I even thought of statically building the site whenever the user makes a change, maybe using Hugo (or VitePress?). Then I would have to take more care with the page recreation and it would be easily routable instead of nesting every component with logic in the frontend... I think. But this I haven't thought through yet.

Can anyone please help?

READ MORE
4 upvotes·117.6K views
Needs advice
on
DjangoDjangoFastAPIFastAPI
and
Next.jsNext.js

I need to build a virtual trading website for a client. I'm considering Next.js for the frontend but can't decide whether to use FastAPI or Django as the backend.

I'll use PostgreSQL for the database. Also, there will be a Mobile version of the website using Flutter. It needs to be able to connect with the backend.

Any advice is greatly appreciated.

READ MORE
7 upvotes·189.8K views
Replies (2)
Senior Software Engineer at ASAPP, Inc·
Recommends
on
Django

While I personally tend to favor FastAPI for my projects, I think Django is the right choice for many. You'll get more feature out of the box, including an ORM, which should allow you to develop your project faster. FastAPI is indeed fast, but utilizes async Python that may be unfamiliar to some devs. Django also has added some async features recently, and those are optional. Also, while FastAPI is great for APIs because it can auto-generate your API docs for you, it sounds like you are not going to have a public API so this may not be needed in your project. And Django has plugins like Django Rest Framework to help create nice REST API endpoints.

READ MORE
6 upvotes·5.4K views

I want to point that, you can still have a fullstack app with next.js with T3 Stack (Next.js + tRPC + TypeScript + Prisma) so your api/server is collocated with your front-end. You can prototype quickly and pivot after to all first if your app grow

READ MORE
2 upvotes·1 comment·5K views
Jörg Benesch
Jörg Benesch
·
November 3rd 2023 at 4:26PM

I have mostly been using Django for work and I'd advice you to use it if you need the powerful admin interface it comes with.

FastAPI can conviniently be extended with SQLAlchemy and gives you the power of well defined APIs with little overhead.

·
Reply
Software Solution Architect at Supernova·
Needs advice
on
PostmanPostman
and
RapidAPIRapidAPI

I'm starting to implement a new full-stack application and adopting an API-first development approach. Right now deciding which of these tools to use to build, mock and track the evolution of my just-born OpenAPI specification.

I'm already familiar with Postman when it comes to consuming ready-to-use implemented API, but not yet with its API-build features. As well as I barely know how FastAPI could help with this goal.

I would like to understand if there'd be a big difference of usage and capabilities between these tools. And any other one that could help on development, test and documentation of a REST API.

Thanks a lot for helping on this!

READ MORE
4 upvotes·69.8K views
Replies (1)
Sr Developer Advocate at Postman·

I'm a little biased because I work at Postman, but I've also used RapidAPI in the past. It won't matter which OpenAPI editor you use, or even if you develop the OpenAPI spec on a third-party platform besides the ones you've mentioned. But I find the automation in Postman far easier to use, and being able to publish your API afterward to everyone makes it a lot easier to let devs find your API and use it right within Postman immediately. The auto-generated docs, the auto-generated client-side samples, and for a handful of languages we even auto-generate some server-side code too.

READ MORE
7 upvotes·10.5K views
Needs advice
on
Amazon S3Amazon S3FastAPIFastAPI
and
PostgreSQLPostgreSQL

Hello, I am trying to build a hobby API that can handle B2B tasks for the supply chain management process. And can be consumed to fit different platforms, such as, mobile applications(android, Ios), & a web app. I am not experienced in building enterprise-grade software. So, I am seeking advice if FastAPI can be used for such software and any other tools or stacks I can apply. Thank you in advance.

READ MORE
8 upvotes·34.1K views
Replies (2)
Software Engineer ·

FastAPI is a solid choice. You'd have to combine it with an ORM like Alembic for database access. Like any tech stack, there come tradeoffs. FastAPI is a smaller framework than something like Django and is optimized.

However, if you want even better performance I'd say you should checkout Rust Rocket. This is a web framework written in rust, which is very fast and can handle much more requests per second than FastAPI. The trade-off here is that you'd have to learn rust if you don't already know it. Also, if you need to develop an admin UI for this application, you can use Django.

Having performant rust will save you money in server costs

READ MORE
4 upvotes·12.5K views

i recommend you to use laravel with swoole and postgresql. laravel orm is so feature-rich and easy to use and it has good speed with swoole and postgresql.

READ MORE
4 upvotes·13.5K views
Needs advice
on
DjangoDjango
and
FastAPIFastAPI

I need to build a full authentication and authorisation service, one of many services in my application. I am deciding between Django and FastAPI to implement this service. The full scope of the service will be authentication, roles and permissions.

My major concerns are developer experience and time savings. Please advise with reasons to choose one over the other.

READ MORE
6 upvotes·32.3K views
Replies (2)
Software engineer at Kovaro·
Recommends
on
Django

Django comes with Auth/Authz built-in, a free admin interface, and probably dozens of ready-made modules for edge cases (i.e: per-object permissions). It is stable and mature. All it requires is that you buy into its ORM. If that's acceptable to you, then Django is probably your fastest bet.

READ MORE
4 upvotes·5.1K views
Lead Software Architect at Edgevana Inc·
Recommends
on
FastAPI

I had the same dilemma and I chose FastAPI over Django because of its better performance. However if you prefer ready to use components over high API efficiency Django is more mature regarding this.

READ MORE
3 upvotes·5.2K views
Needs advice
on
DjangoDjango
and
FastAPIFastAPI

I'm a Data Engineer, looking to build some web apps in my spare time, especially on weekends. I'm debating between choosing Django over FastAPI. What I am pondering are performance, development speed, ease of management, scalability, and support if I ever need to use another frontend framework (eg React). Please help me with advice, I would appreciate it!

READ MORE
5 upvotes·40.1K views
Replies (3)
Recommends
on
Django

From what you describe I think you want to go with a full stack framework that has everything you need in one go which django will give you out of the box. Don't get me wrong, FastAPI is awesome but you have to sort of plumb several things together to build an API. Even though there are boilerplates and cookiecutter templates you have to understand all of its components sooner rather than later. I would use it only for building API components of a system.

READ MORE
8 upvotes·1.4K views
Recommends
on
Django

As all said, both are strong, yet they are different, Django is batteries included framework, which handles from the request till the response is generated and returned to the user as a rendered HTML, on the other hand, FastAPI is a framework for API developement which needs another framework like `React or Angular to parse the response and renders the HTML. For a beginner, Django will be simpler and powerful.

READ MORE
5 upvotes·921 views
View all (3)
Needs advice
on
Django REST frameworkDjango REST framework
and
FastAPIFastAPI

Not sure if we should use DRF or FastAPI. I hear many good things about FastAPI, but it doesn't seem to have a big community. Most important things for us: - speed - ease of development - scalability & security

We're likely going to use MongoDB, so not sure if that changes anything. Would appreciate any help!

READ MORE
5 upvotes·62.5K views
Replies (4)
Full Stack Engineer-Freelancer at HemansAI·
Recommends
on
FastAPI

I have worked with both frameworks, for your use case I would recommend using FastAPI. DRF, is no doubt an amazing framework and makes various things easy, but Django's MongoDB support is not that good currently, and since its a big framework, there are various things DRF and Django automatically do when you are using their predefined backend engines, which is not in the case of the MonoDB a NoSQL db. FastAPI will give you the flexibility and speed, for the community front, its also growing quite well there.

READ MORE
5 upvotes·1 comment·30.5K views
dagrimm
dagrimm
·
June 4th 2021 at 9:03AM

I think you ask the wrong questions. "Most important things - speed - ease of development - scalability & security" are more ops related tasks and can be handled by both frameworks well. You should ask what the framework should do - fastAPI is perfect for REST APIs, DRF is a REST framework on top of Django. So, if you have an application, where you build a user management system, CRM, analytics, etc. and you want to have a REST API on top of the monolithic backend, DRF might suit you well. If you are about smaller services with the focus on the REST part, fastAPI might fit you better. On the Mongo part, I agree that DRF is opinionated towards relational databases.

·
Reply
ETL Developer at Tellus Home·
Recommends
on
FastAPI

FastAPI might not have a big community but the documentation is awesome and covers every aspect of the framework itself. I'd recommend coming up with a pilot project yourself and try it on your own. It has a bit learning curve as FastAPI itself is a combo of a few existing projects otherwise it is amazing.

READ MORE
5 upvotes·29.9K views
View all (4)