{"id":283,"title":"FastAPI","content":"<p>FastAPI nedir? modern ve h\u0131zl\u0131 bir Python web framework\u2019\u00fcd\u00fcr.<br>H\u0131z: Ad\u0131ndan da anla\u015f\u0131laca\u011f\u0131 gibi \u00e7ok h\u0131zl\u0131 performans sunar. NodeJS ve Go ile kar\u015f\u0131la\u015ft\u0131r\u0131labilir seviyede h\u0131zl\u0131d\u0131r.<\/p><p>Kullan\u0131m Kolayl\u0131\u011f\u0131:<\/p><p>from fastapi import FastAPI<br>app = FastAPI()<br>@app.get(\"\/\")<br>def read_root():<br>&nbsp;return {\"Hello\": \"World\"}<\/p><p>3. Otomatik API Dok\u00fcmantasyonu:<br>- Swagger UI (\/docs) ve ReDoc (\/redoc) aray\u00fczlerini otomatik olu\u015fturur<br>- API\u2019nizi test etmek ve dok\u00fcmante etmek \u00e7ok kolayd\u0131r<\/p><p>4. Modern Python \u00d6zellikleri:<br>- Python 3.6+ type hints kullan\u0131r<br>- Async\/await deste\u011fi<br>- Pydantic ile veri do\u011frulama<\/p><p>5. G\u00fcvenlik \u00d6zellikleri:<br>- JWT token deste\u011fi<br>- OAuth2 deste\u011fi<br>- CORS yap\u0131land\u0131rmas\u0131<\/p><p>Ba\u015flang\u0131\u00e7 i\u00e7in yapman\u0131z gerekenler:<\/p><ol><li>Kurulum:<\/li><\/ol><ul><li>Kurulum:<\/li><\/ul><p>pip install fastapi<br>pip install uvicorn # ASGI server<\/p><p>2. Basit bir uygulama:<\/p><p>from fastapi import FastAPI<br>from pydantic import BaseModel<br>app = FastAPI()<br>class Item(BaseModel):<br>&nbsp;name: str<br>&nbsp;price: float<br>@app.post(\"\/items\/\")<br>def create_item(item: Item):<br>&nbsp;return item<br># \u00c7al\u0131\u015ft\u0131rmak i\u00e7in:<br># uvicorn main:app - reload<\/p><p>FastAPI\u2019nin \u00f6\u011frenme e\u011frisi olduk\u00e7a d\u00fc\u015f\u00fckt\u00fcr ve modern web uygulamalar\u0131 geli\u015ftirmek i\u00e7in harika bir se\u00e7enektir. \u00d6zellikle REST API\u2019ler geli\u015ftirmek i\u00e7in idealdir.<\/p><p>Ba\u015fka spesifik bir konu hakk\u0131nda bilgi almak ister misiniz? \u00d6rne\u011fin:<br>- Veritaban\u0131 entegrasyonu<br>- Authentication sistemleri<br>- WebSocket deste\u011fi<\/p>","excerpt":"FastAPI nedir? modern ve h\u0131zl\u0131 bir Python web framework\u2019\u00fcd\u00fcr.\r\nH\u0131z: Ad\u0131ndan da anla\u015f\u0131laca\u011f\u0131 gibi \u00e7ok h\u0131zl\u0131 performans sunar.","created_at":"2024-12-22 22:59:15","updated_at":"2026-09-05 14:02:59","category_id":9,"view_count":669,"reading_time":2,"status":"published","editor_choice":0,"is_editor_choice":0,"published_at":"2024-12-22 22:59:15","featured_image":"resimyok.jpg","slug":"fastapi","category_name":"Yaz\u0131l\u0131m","category_slug":"yazilim"}