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.
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.
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
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.