When building FastAPI apps, we often focus on routers, schemas, and dependencies — but forget the quiet little hero that holds it all together: 👉 __init__.py Yes, it’s usually empty — yet incredibly powerful. Here’s why 👇 ⚙️ It tells Python that the folder is a package, not just another directory. 📦 It allows relative imports like from .models import User. 🧠 It keeps your app modular and scalable as you split routers, services, and utils. 🪄 It can even run package-level setup logic, like initializing logs or environment configs. Even though Python 3.3+ allows “implicit packages,” adding __init__.py is still a best practice — it makes your FastAPI structure clean, predictable, and bug-free. 💬 Funny how an empty file can make such a big difference, right? #FastAPI #Python #BackendDevelopment #CleanCode #WebDevelopment #Developers
The Power of __init__.py in FastAPI Apps
More Relevant Posts
-
💡 Saturday reflection: Building full-stack web apps with pure Python just got more accessible. Just discovered how Reflex enables creating sophisticated multi-page applications with real-time database interactions, filtering, and analytics - all without touching JavaScript. The tutorial demonstrates a complete notes-management dashboard built entirely in Python that runs smoothly in Colab. My personal reflection: This represents a significant shift in web development accessibility. Python developers can now build complex web applications without context-switching between languages, potentially accelerating development cycles and lowering the barrier to full-stack development. Read more: https://lnkd.in/evMNCv2i What do you think about this development? #TechThoughts #Saturday #TechReflection #Weekend This content was automatically generated with an agent I designed in n8n. Want one for your business? Send me a DM ✉️
To view or add a comment, sign in
-
-
Tech With Tim: How I Would Learn Python Web Development If I Started Over If I were starting over with Python web development today, I’d kick things off by nailing the fundamentals (Python basics, HTTP, REST) and getting comfy with your toolkit (editors, Git, etc.). From there, dive into frameworks—Flask for quick prototypes, FastAPI for modern async apps, then Django when you’re ready for a full-stack powerhouse. Layer in databases & ORMs, tackle authentication/authorization, and build a real-world project to cement those skills. Once you’ve got your app up and running, deploy it on a service like Railway (bonus: $20 in free credits!), then level up with advanced techniques, optimizations, and best practices. Follow this roadmap to spend less time confused and more time actually shipping cool Python web apps. #python #webdevelopment Watch on YouTube https://lnkd.in/ge349b9W
To view or add a comment, sign in
-
Hi, I wanted to share something interesting about a Python library called Streamlit. It’s a web application library that allows you to create interactive web apps easily. I looked at the documentation and decided to create a simple web application that functions like a calculator. This app accepts user input and performs basic mathematical operations, including addition, subtraction, multiplication, and percentage calculations. I really enjoy using Streamlit because it eliminates the need to write HTML and CSS code. I was able to create a sample web app that performs these basic mathematical operations. I want to thank the Streamlit developers for creating such a fantastic library. Additionally, I’ve provided a sample video that demonstrates how to use the app to perform these operations. #Python #streamlit #dataScience #coder link : https://lnkd.in/gZRDHdHX
To view or add a comment, sign in
-
I’ve been working on a fun little side project called GitDiffer, it’s a combo of a Python script and a simple web app. The script spits out a JSON file with detailed Git diff info, and the site lets you load that file to browse, filter, and sort changes in a much cleaner way. In the example, I am using output from a @IntuneCD backup to view #msintune config diffs. Play around with it and let me know how it works out for you! GitDiffer site: https://lnkd.in/dwYKdsHY Github: https://lnkd.in/dUEu6GXD
To view or add a comment, sign in
-
🚀 Exploring FastAPI: Python’s Powerhouse for Web Development 🚀 Today, I dove into FastAPI, a Python framework built on Pydantic and Starlette, and here’s why it’s a game-changer: 🔹 Simplicity: FastAPI makes CRUD operations effortless. 🔹 Speed: Thanks to Starlette’s async foundation, FastAPI delivers lightning-fast performance—ideal for modern apps. 🔹 Auto-Docs: The built-in /docs route generates interactive Swagger UI. No manual documentation needed! 🔹 ML Integration: Easily integrated machine learning models, handling heavy computations smoothly with async capabilities. Why Use FastAPI? ✨ Beginner-friendly with clear documentation. ✨ Scales seamlessly from small projects to enterprise-level apps. ✨ Future-proof with asynchronous support for real-time applications. #Python #FastAPI #MachineLearning #Masaiverse #DailyLearning
To view or add a comment, sign in
-
Flask: Production-Ready API in 6 Lines app = Flask(__name__) @app.route('/predict', methods=['POST']) @jwt_required() def predict(): return jsonify(model.predict(request.json['data'])) Add JWT + Gunicorn + Nginx = secure, scalable. Deployed fraud detection API serving 10K RPM. #Flask #Python #API #Backend
To view or add a comment, sign in
-
What if Python treated WebSockets as a first-class citizen — not an afterthought? Imagine building real-time systems — chats, dashboards, multiplayer apps — with: - "Async from top to bottom" - "Zero blocking" - "Rust-level speed under the hood" Most teams today face this trade-off: ⚙️ Django: solid ecosystem, but not truly async (WebSockets feel bolted on) ⚡️ FastAPI: modern and async, but WebSockets and background tasks still get tricky at scale 🧠 Something new: what if a framework gave you both — Python’s simplicity and Rust’s concurrency? Hypothetically — if you could get 5–10× more concurrent connections, lower latency, and native real-time features (rooms, presence, pub/sub) out of the box… 👉 Would you switch? I’d love to hear honest thoughts — what stops you from building truly real-time apps in Python today? #python #websockets #realtime #rust #async #webdev #opensource
To view or add a comment, sign in
-
-
Python devs, check this out: You can build full-stack apps from a single prompt and have them running the same afternoon. I’ve been trying Reflex, an open-source Python framework and AI App Builder that goes from prompt to production in minutes. Everything, front end and back end, stays in Python with the flexibility and performance you’d expect from a JS app. It automatically connects to any PyPI package or API. It built a real-time sales dashboard tracking revenue, conversion rates, and team performance across regions with live updates. All in Python. If you build internal tools, dashboards, or AI-powered apps, this is one of those “how did I not know about this earlier” tools. —— 👋 Try it: https://lnkd.in/epQ3ztry ——— Shoutout to them for partnering on this post.
To view or add a comment, sign in
-
Python Project Series: Part 31 - Typing Speed Test It’s been over two weeks since the last project. I know, I know… the streak took a coffee break. But we’re back, and this time, on the web! After 30 terminal-based projects, this starts a new chapter: our transition to web-based development using Flask (Python) and JavaScript. For this one, I built a Typing Speed Test App that measures WPM and accuracy, with difficulty-based paragraphs and a clean UI. A small yet fun project and a solid start to the web era of the series. Break taken, Focus restored and Projects resumed #PythonProjectSeries #Flask #WebDevelopment #LearningByBuilding #KeepCoding #Frontend #Backend #100DaysOfCode #PythonProjects #ProjectSeries #Part31
To view or add a comment, sign in
-
Tech With Tim: How I Would Learn Python Web Development If I Started Over How I’d Tackle Python Web Dev From Scratch I’d start by nailing down the fundamentals—basic Python concepts, essential tools (like Git and virtual environments) and the overall web stack—before jumping into deployment with Railway’s free credits. From there, I’d explore Flask for simple apps and FastAPI for high-performance APIs, then layer in databases/ORMs and authentication/authorization to get real-world skills under my belt. Once you’ve got the core pieces in place, build a full-blown project to tie everything together, then dive into Django for a batteries-included framework. Finally, learn how to deploy your apps and sprinkle in advanced techniques to level up your development game. Watch on YouTube https://lnkd.in/gBkfHhw4
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development