Automatically translated.View original post

FastAPI is different from Flask....Is it???

# Web Site Writing Basics # Fastapi # Pythonprogramming # Flask # Trending

In a simple way, Flask is a "tool." The REST API is a "data transmission format." 1.What is Flask? (The Tool) Flask is a web framework of the Python language. It's like a "device box" that makes it easier for you to build a website or a backyard system. You don't have to write all the server management code from the page center: Routing, User traffic, Connect Ability Database: Flask can do either a website with an HTML page or just through the data (API). 2.What is the REST API? (The Concept / Architecture) The REST API is an "architecture or rule" to communicate data between computers through the HTTP protocol, focusing on sending data in a standardized format (mostly JSON). Duty: Intermediary, let the App command a Server, or let Frontend talk to the Backend. Characteristics: Not focusing on the face (UI), but focusing on sending pure "information," such as username, product price, etc. 3. Difference Comparison Table Topic FlaskREST API Type Framework (Written Software) Architecture Style (Design Pattern) The driver page for the web to work, how to send data to other machines, understand what to see, the .py code file we run, the URL format and the JSON / XML relationship data, we use Flask to create the REST API as the result of writing Flask4. For example, imagine opening a restaurant.: Flask is "Kitchen and Chef": it is responsible for cooking, handling raw materials (manage the Logic in the back of the house). REST API is "Menu and Reception": It is an agreement that if the customer orders Menu A (Request), the chef will send out this dish in any form. Response: You do not choose between Flask or REST API, but usually you will "use Flask to create a REST API" (like using kitchen utensils to cook.

5/4 Edited to

... Read moreหลายคนเสิร์ชว่า “flask python คือ” เพราะเจอคำว่า Flask ในคลิป/คอร์ส แล้วงงว่ามันคือภาษาใหม่ไหม หรือเป็น REST API ไปเลย? จากที่ผมเริ่มทำโปรเจกต์เล็กๆ ด้วย Python คำตอบสั้นๆ คือ Flask เป็น “Web Framework” (เครื่องมือทำเว็บ/ทำหลังบ้าน) ที่ช่วยให้เราเขียนโค้ดรับ-ส่งข้อมูลผ่าน HTTP ได้ง่ายขึ้น โดยไม่ต้องจัดการรายละเอียดระดับเซิร์ฟเวอร์เองทั้งหมด Flask ทำอะไรได้บ้าง (ภาพรวมที่ใช้บ่อย) - ทำเว็บแบบมีหน้า HTML (เช่น หน้า login, หน้าแอดมิน) - ทำ Backend สำหรับแอปมือถือ/เว็บ (ส่งข้อมูลเป็น JSON) - ทำ REST API เช่น endpoint /users, /products เพื่อให้ Frontend เรียกใช้งาน - ต่อฐานข้อมูลผ่านไลบรารี/ORM อย่าง SQLAlchemy ตัวอย่างสถานการณ์ที่เจอจริง ตอนผมทำระบบหลังบ้านเล็กๆ ให้เว็บร้านค้า อยากได้ API สำหรับ “ดึงรายการสินค้า” และ “เพิ่มสินค้าใหม่” Flask ช่วยให้ผมสร้าง route ได้เร็วมาก เช่นกำหนด URL แล้วคืนค่า JSON ได้ทันที ทำให้ฝั่ง Frontend หรือแอปมือถือเรียกใช้งานสะดวก นี่แหละภาพของ REST API ที่เกิดจากการใช้ Flask เป็นเครื่องมือ แล้ว FastAPI ต่างจาก Flask ยังไง (มุมที่คนมักสนใจ) - ความเร็วในการพัฒนา: Flask เรียบง่าย เริ่มไว เหมาะกับงานเล็ก-กลางหรืออยากคุมโครงเอง - โครงสร้างและมาตรฐาน API: FastAPI เด่นเรื่องการทำ API โดยเฉพาะ มีระบบ type hints, validation และเอกสาร API (เช่น Swagger UI) อัตโนมัติ ทำให้ทีมคุยกันง่ายขึ้น - ประสิทธิภาพ: FastAPI มักถูกพูดถึงเรื่องรองรับงาน async ได้ดี เหมาะกับงานที่มี I/O เยอะๆ (เรียกบริการอื่น/อ่านเขียนฐานข้อมูลหนักๆ) แต่ Flask ก็ทำงานได้ดีมากในงานทั่วไป เลือกใช้อะไรดี? - ถ้าเพิ่งเริ่มและอยากเข้าใจพื้นฐาน web development ของ Python: Flask เป็นจุดเริ่มที่ดี เพราะแนวคิดตรงไปตรงมา - ถ้าเป้าหมายคือทำ REST API แบบจริงจัง มีสคีมาชัด ต้องการเอกสาร API อัตโนมัติ: ลอง FastAPI จะคล่องกว่า สรุปให้จำง่าย: Flask คือ “เครื่องมือ (framework)” ส่วน REST API คือ “รูปแบบการออกแบบการสื่อสาร” และทั้ง Flask กับ FastAPI ต่างก็เป็น Web Framework ของ Python ที่ใช้ทำ API ได้เหมือนกัน เพียงแต่จุดเด่นและวิธีทำงานบางอย่างต่างกันครับ

Related posts

A tablet on a stand displays the Mathigon Polypad website, featuring interactive math tools and activities. A pink and white keyboard is in the foreground, illustrating a student's study setup.
A tablet displays the Scite.ai website, an AI research assistant. The screen shows options to ask questions and summarize research, highlighting its utility for writing papers and citing sources.
A tablet displays the Cymath.com website, a math problem solver. The screen shows an input field for problems and options to choose topics, emphasizing its step-by-step explanations for algebra and calculus.
I used these instead of pulling all-nighters ✨
No all-nighters. No burnout. No last-minute panic. This semester was my busiest yet, but somehow…I made it out with a 4.0 GPA. And no, it wasn’t because I studied 24/7 or drank six coffees a day. The real reason? I leaned on 10 underrated websites that quietly carried me through every assignment,
Byaombe •••

Byaombe •••

4793 likes

The image displays a digital profile for Nathan Wayne Salles, an AI architect, detailing his role, operating entity, tech stack, and AI core (Claude). It also lists various "nws-" system components, suggesting a complex AI framework. The Lemon8 handle @nathansalles160 is visible.
Is anyone Real? Im too stupid to make this money
💵 Price:Priceless
I AM THAT I AM

I AM THAT I AM

3 likes

💡These hands-on labs are built specifically around real Al/ML production challenges. If you're looking to take your Al/ML projects to production, this is a great place to start #machinelearning #aiengineer #techtok
lindavivah

lindavivah

0 likes

What’s in my gym bag… 💪🏼
All the gym bag essentials! - cable kickback ankle straps - foam roller - foam bar protector - leg bands - wash/ locker room bag - water bottle - headphones - facial bacteria spray #gym bag #gym essentials #gymsharkbag #small gym bag for woman #gymshark everyday gym bag
Adrianna ceglia

Adrianna ceglia

1443 likes

A game settings screen showing 'DISPLAY' options. VSync is off, Field of View is 87, HUD Display Area is 80, and Menu Display Area is 90. Text at the bottom says "I use Kontrol Freeks with black perf ring."
A game settings screen showing 'CONTROLS' options. Vibration is disabled, Gadget and Drone Deployment are Advanced, Leaning Behavior is Alternate, and Vertical Sensitivity is 45.
A game settings screen showing 'CONTROLS' options. Horizontal Sensitivity is 80, Left and Right Stick Dead Zones are 5%, Trigger Dead Zones are 0%, and Controller ADS Sensitivity is set to Hold Aim.
Alix

Alix

0 likes

How Important Is It to Test Your Aquarium Water?
Let’s talk about water testing, because honestly… it’s one of the biggest keys to keeping your betta (or any fish) healthy. A lot of people test their water super frequently for different reasons — maybe their tank is spiking, maybe they didn’t fully cycle it, or maybe they’re dealing with algae
SedTales 🌍

SedTales 🌍

2 likes

A laptop screen displays a VS Code interface with HTML code. A "VS CODE PETS" section shows a cat and a dog. The image has an overlay text "extensions to girlify your vs code setup", suggesting a customization guide.
A VS Code interface is shown with a dark theme and standard file icons, displaying HTML code. An overlay text asks, "tired of your vs code looking like this?", implying this is a default or uncustomized setup.
This image lists four VS Code extensions: Kawaii Theme, Celestial Magic Girl Icon Theme, vscode-pets, and Bongo Cat. Each entry includes a brief description and options to enable or uninstall, showcasing customization options.
extensions to girlify your vs code setup 💻🌸
Is your VS Code looking boring? Here are 4 cute extensions to add to make your workspace cute! 🎀 Kawaii Theme — Cute dark mode theme with purple and pink accents! If you love cute pink themes, but don’t want to code in light mode, this is a great alternative! 🎀 Celestial Magic Girl Icon Theme
♡

♡

1287 likes

Plus Size Fall Fit (Pt. 4)
this one is so simple and can be styled so many different ways!! 🤎 headband: https://a.co/d/1H4D70g tube top: http://api-shein.shein.com/h5/sharejump/appjump?link=lVoSkXbi4U1&localcountry=US&url_from=GM7573482005574828032 button down: (thrifted) jeans: http://api-shein.shein.co
Brielle Griffin

Brielle Griffin

16 likes

Micro Hydroflask w/ Labubus ✨
Some people collect stamps… I collect Labubus and micro hydroflask💦 @Whole Foods #labubu #hydroflask #softaesthetic #fyp #kawaiifinds
WithMaiHeart

WithMaiHeart

58 likes

Cleaning my dads dirty hydroflask
Oweeeee👏🏽
Lifewithsydneyx

Lifewithsydneyx

2861 likes

Like omg I really just be looking for packages until I get tired 😂📦 #creator #ugc #influencer #ugccreator #pr
Jaaaaaymomma

Jaaaaaymomma

1 like

A smartphone displays the ChatGPT interface, resting on a beige stand with jewelry and a white candle in the background, illustrating a comparison between Gemini and ChatGPT.
This image describes ChatGPT as a 'chatty bestie,' highlighting its ability to brainstorm, offer custom GPTs, and its friendly, versatile nature for conversations.
This image characterizes Gemini as 'the organized one,' emphasizing its accurate, up-to-date information, great photo/video generation, and seamless integration with Google Suite.
Gemini vs ChatGPT - which one is actually better?
If you’ve been wondering whether ChatGPT or Gemini is better… well, same 😅 So I tested them side-by-side, asked them the same questions, checked their answers, and compared how they generate photos - and they’re definitely different. ChatGPT feels like your chatty bestie who’s always ready to b
Unrealtoreal

Unrealtoreal

68 likes

A person takes a mirror selfie in a modern setting, wearing a grey cardigan and black pants. Overlay text reads "MUST KNOW TECH TERMS for business students," introducing the article's topic.
Miniature paragliders are suspended from a high ceiling in an indoor space. Overlay text prompts, "studying business and want to work in tech? see if you know these terms: SWIPE," with an arrow.
An open textbook is shown with an outdoor background featuring chairs and a screen. Key tech terms "Agile," "API," and "Cloud Computing" are overlaid, highlighting concepts discussed in the article.
Tech terms every business student should know
as someone studying both tech and business, i've realized how important it is to understand the industry lingo no matter your role. here's a quick guide to some common terms from the intersection between technology & business that i’ve learned as a student/through my internships: agil
vvanessaww

vvanessaww

13 likes

Easy jewelry organizer✨
There are different sizes at Walmart! So you can use for all kinds of jewelry. Soooo good for travel too! 🎉 #jewerlyoflemon8 #jewelry #necklace #jewelryhack #jewelryhaul
Braylee Bryant

Braylee Bryant

4 likes

Erlenmeyer Flask Vase - Simple Spooky Girl Diy
Another easy Dollar Tree diy! This one is perfect for all my spooky girls, goth home decor fans, or Halloween lovers. A simple Erlenmeyer Flask type vase. 👩🏻‍🔬 I saw these vases at @dollartree and was immediately reminded of an Erlenmeyer Flask. I love adding "mad scientist" type items
darkstarhome

darkstarhome

74 likes

🚀 2025 AI Learning Roadmap: From Zero to Employmen
Hey everyone! 🌟 Here's a comprehensive AI learning roadmap to help you go from a beginner to a professional in the field of AI by 2025. Let's break it down into nine stages: ---- 1️⃣ Build Strong Foundations • Python: Master the basics of Python programming. • Data Processing: Learn l
Valder

Valder

877 likes

An illustration of a person at a computer with 'How to Mod Stardew Valley' on the screen, surrounded by plants and two dogs, setting the scene for a modding tutorial.
Screenshots from NexusMods.com showing the Vortex Mod Manager download page, highlighting the 'MANUAL DOWNLOAD' option for Vortex version 1.11.7.
A Vortex popup indicating 'Additional files required' (.NET 6.0+, Windows 10+) with a download button, followed by a NexusMods download page showing 'Slow Download' selected.
✨ A Tutorial for Modding Stardew Valley! 🐓
Hello, lovelies! I have made a few Stardew Valley Mod posts and I had someone ask on one of them if I could make a tutorial. So I finally had the time to throw this together. I was luckily able to make it into 1 part! I have no idea how I managed to, but I did! Modding and mods on Nexus are comp
Ginger ✨☕️

Ginger ✨☕️

187 likes

My culinary discoveries from Portneuf.
I spent a few days of vacation in the Portneuf region. So, in addition to visiting family members and relaxing, I took the opportunity to visit some shops and here are my food finds. J'ai passé quelques jours de vacances dans la région de Portneuf. Donc, en plus de visiter des membres de ma
easyveggiecooking🇨🇦⚫️

easyveggiecooking🇨🇦⚫️

2 likes

Books by Asian authors to read during AAPI Month
I’m sorry this is so late! May was hectic and then Canva wasn’t working. I tried to compile a list with a bunch of different genres *I have not read all of these #aapibooks #books #booksoflemon8 #fantasy #horrorbooks
Abibelle

Abibelle

5 likes

Gym flicks from today🌸🕐
#CapCut @Nike @Honda #thermoflask #gymvlogs #asmr
🍯☁️

🍯☁️

1 like

Ham and glutes day from a hybrid gym girlie
Ham and Glutes from a hybrid gym girly hip thrust 4x6 EZbar deficit RDLs 3x12 Bulgarian split squats 3x10 Good mornings 3x8 Leg crossover cake kickback 3x12 40mins easy pace run Ham and glutes from a hybrid gym girly My main goal when it comes to my training is to improve over all stren
Juanis Prada

Juanis Prada

2 likes

Two special edition books, "Powerless" (purple with a sword design) and "Reckless" (red with a dagger design), feature intricate gold foil details on their covers, resting on an open book page.
Two open books display colorful illustrated endpapers. The top shows a man and woman in a dynamic pose with a sword, while the bottom depicts them in an intimate embrace surrounded by red poppies and chains.
Two closed books, purple and red, are shown from the side, revealing their spines and fore-edges adorned with intricate floral designs, set against a backdrop of text pages.
Powerless and Reckless from Bookishbox
#booksubscriptionbox #specialeditionbooks #romantasy
Death.by.tbr

Death.by.tbr

9 likes

Beating the Boredom of Online Lab Videos ✨🫶
Online labs can be… a DRAG! Like scrolling for 30 mins because I don’t want to sit through a 20 minute lab video because it’s so dry. Not gonna lie, clicking through simulations and typing up reports alone isn’t exactly thrilling. But I’ve found a few things that help when it starts feeling lik
Stella Studies

Stella Studies

23 likes

4 Powerful Websites You’ll Wish You Knew Sooner
Always working smarter, not harder. These AI tools will help you code faster, automate tasks, and manage projects like a pro. Here’s what to try + prompts to get started: 1. Replit – Code, collaborate, and deploy directly in your browser. 👉 replit.com Prompt: Build a Python Flask API that ac
Deft Point Consulting

Deft Point Consulting

89 likes

Cruel is the Light from Fairyloot 🫶
#booksubscriptionbox #bookreccomendation #specialeditionbooks
Death.by.tbr

Death.by.tbr

8 likes

Blood and Ashes set from Arcane
#specialeditionbooks #booksubscriptionbox #frombloodandash #bookreccomendation #books
Death.by.tbr

Death.by.tbr

22 likes

DIY flask
#gettoknowme #flask #paint #DIY
Diper Mosley

Diper Mosley

1 like

DIY Wedding Wagon
Here is step by step on how I took this < from this > Now I did not come up with this idea fully on my own. I knew that I wanted to include wagon’s in our wedding but I did not know how to incorporate decorations into my idea. So with that being said STRAIGHT to TikTok I went! I immediate
AG McMichael🤍🫶🏻

AG McMichael🤍🫶🏻

12 likes

A flat lay of various Dollar Tree beauty and personal care products, including lotions, makeup, razors, body butter, and other items, with text overlay "Dollar Tree Finds!" and "SWIPE".
Three white bottles of HempHappy Hemp Seed Oil Body Lotion in Original, Pineapple & Honeydew, and Coconut scents, displayed on a dark textured surface.
A collection of Dollar Tree beauty products, including L.A. Colors highlighter and contour sticks, brow gel, face primers, color-shifting eyeshadows, lip balms, crystal lip glosses, and liquid concealers.
New Dollar Tree Finds 🛍️
❤️Hello My Boujie Budget Baddies 🤑 I hope you’re all having an amazing day! If you’re new here WELCOME! I hope you consider following me for content like this & MORE😁 ‼️Some new Dollar Tree beauty finds! What are some things you’ve found so far? I really love EVERYTHING I come across at DT.
HeyItsAshleyK1

HeyItsAshleyK1

364 likes

flask, but make it stanley 🌸
got so many compliments at the pool today, so convenient and cute i loveeee #stanleyflask #flask #stanley #drinking #summerneeds
chianne🎀

chianne🎀

538 likes

tips on staying HYDRATED!💧
it is SO important to make sure we’re drinking enough water!! water helps our bodies and brains function. but it’s easy to forget to drink it, for me anyway. here are some tips and tricks I like to follow on trying to remember to drink enough water! I hope this helps😊🧊💧 #healthyhabits #letsch
ash☀️

ash☀️

35 likes

See more