Day 65 of #90DaysOfCode Today I built a Flask web application to collect and display cafe data including location, opening hours, coffee quality, wifi strength, and power availability. The application allows users to submit cafe details through a form, which is validated on the backend and stored in a CSV file. The stored data is then rendered dynamically on a separate page. Key features implemented • Form handling using Flask-WTF • Input validation using WTForms • Handling GET and POST requests in Flask • Data storage using CSV files • Dynamic rendering using Jinja templates • Redirect flow after form submission Key concepts learned • How form submission works in backend systems • Difference between GET and POST requests • Validating and processing user input • Structuring Flask applications properly This project gave me a clearer understanding of how backend systems handle user input and store structured data. GitHub Repository https://lnkd.in/gNvjnbZT #Python #Flask #BackendDevelopment #WebDevelopment #SoftwareEngineering #90DaysOfCode
Building a Flask Web App for Cafe Data Collection
More Relevant Posts
-
Day 66 of #90DaysOfCode Today I built a Flask web application to manage a personal book library using SQLite and SQLAlchemy. This is my first project where I integrated a database instead of relying on file-based storage, which made the application more structured and scalable. The app allows users to add books with title, author, and rating, and stores them in a database that is dynamically rendered on the homepage. Key features implemented • SQLite database integration • SQLAlchemy ORM for data modeling • Dynamic data retrieval and rendering • Form handling with validation • Backend data persistence Key concepts learned • How databases integrate with backend applications • Using ORM instead of manual file handling • Structuring models using SQLAlchemy • Managing and querying persistent data This project gave me a much clearer understanding of how real-world applications manage data. GitHub Repository https://lnkd.in/gTAqTzFW #Python #Flask #SQLAlchemy #BackendDevelopment #WebDevelopment #90DaysOfCode
To view or add a comment, sign in
-
𝗗𝗮𝘆 𝟲𝟴 𝗼𝗳 𝟭𝟬𝟬 𝗗𝗮𝘆𝘀 𝗢𝗳 𝗖𝗼𝗱𝗲 - 𝗗𝗷𝗮𝗻𝗴𝗼 𝗙𝗼𝗿𝗺𝘀 You learned about models and ORM yesterday. But all data was created through the admin panel. Today you learned about Django Forms. This lets users submit data from the browser directly. A Django Form is a Python class that handles three things: - Rendering HTML input fields - Validating submitted data - Giving you clean, safe data to work with Django has two kinds of forms: - Form - a standalone form, not tied to any model - ModelForm - a form generated directly from a model You can use fields like: - CharField for short text input - EmailField for email input with validation - IntegerField for number input A form view handles two scenarios: a GET request and a POST request. The standard Django form view pattern is: - If POST - bind the submitted data to the form - Validate with is_valid() - If valid - save and redirect - If GET or invalid - render the form You can render fields manually for more control over layout. is_valid() runs two levels of validation: field-level and custom validation. Source: https://lnkd.in/gNhPdWnc
To view or add a comment, sign in
-
My FastAPI Journey — and things are getting exciting! Module 2: Core Basics Coming from a Django background, I've been exploring FastAPI and today I completed Module 2: Core Basics — and I'm genuinely blown away by how clean and powerful it is! 🔥 What I built today: A complete Notes REST API with full CRUD operations using just Python! ✅ Here's what I implemented: 📌 GET /notes — Fetch all notes from the database 📌 GET /notes/{note_id} — Fetch a specific note using Path Parameters 📌 POST /notes — Create a new note with auto-generated ID 📌 PUT /notes/{note_id} — Update an existing note by ID 📌 DELETE /notes/{note_id} — Delete a note and return confirmation 💡 Key concepts I learned: 🔹 Path Parameters — Passing values directly in the URL like /notes/1 to fetch specific records. FastAPI automatically converts and validates the data type! 🔹 Query Parameters — Filtering data using URL params like /search?keyword=Python — no extra configuration needed! 🔹 Request Body — Sending structured JSON data to the server using Pydantic models for automatic validation 🔹 Response Model — Controlling exactly what data is returned to the client for security and clean APIs 🔹 Auto Swagger Docs — FastAPI automatically generates interactive API documentation at /docs — no extra tools needed! ⚡ What makes FastAPI special compared to Django: → No need for separate serializers — Pydantic handles validation automatically → No need for urls.py — routes are defined directly on functions → Auto generated API docs out of the box → Built on ASGI (Uvicorn) making it significantly faster This is just the beginning — next up: 📦 Pydantic Data Validation 🗄️ Database Integration with SQLAlchemy 🔐 JWT Authentication 🚀 Deploying a Production API Learning in public — follow along for daily updates! 💪 #FastAPI #Python #REST #API #BackendDevelopment #Django #LearningInPublic #100DaysOfCode #WebDevelopment #SoftwareEngineering #CRUD
To view or add a comment, sign in
-
50 orders. 51 database queries. That's what I found when I finally checked the query count on an endpoint I'd shipped two weeks earlier. Looked fine in local. Response times were normal — but I was testing on maybe 8 records. Real data hit it and the thing crawled. 4+ seconds for a simple order list. One JOIN. Done. The 4-second response dropped to under 80ms. But here's the thing — the broken code reads fine. There's nothing obviously wrong with it. You'd write it without blinking. I did. The ORM hides the cost so well that you only find out at the wrong moment. I've got django-debug-toolbar running locally now. Not optional anymore. For M2M or reverse FK relations it's prefetch_related — different mechanism, same idea. Worth knowing which to reach for before you need to. How are you catching N+1s before staging — toolbar, SQL logging, something else? #django #python #djangorestframework #backenddev #pythondev
To view or add a comment, sign in
-
-
A new issue is open in django-modern-rest: https://lnkd.in/dQrvvXzg This one is about improving test performance in dmr_rf and dmr_client. The idea is to optimize the JSON encoding path used in tests, since json.dumps is slower and the project may be able to reuse a faster approach already used elsewhere. Why it matters: this is a practical performance task in a real Python/Django codebase. If you want to take it: - check the issue thread first - make sure it is still unassigned - ask in the issue if you can take it - get maintainer confirmation - then start At Kanzu, we’ll occasionally share selected contribution opportunities around real Python work.
To view or add a comment, sign in
-
Ever tried explaining a complex database schema to a teammate or client using just code? It can be a headache. I found a way to automate the entire process. Using Django Extensions, you can generate a full visual diagram of your project’s models directly from your terminal. Here’s how to do it in 3 easy steps: 1- Install the tools: pip install django-extensions pygraphviz (Note: You can also use pydotplus if you prefer!) 2-Add to your apps: Don't forget to add 'django_extensions' to your INSTALLED_APPS in settings.py. 3- Run the command : "python manage.py graph_models -a -o my_project_schema.png" Boom! You have a high-quality visual representation of your database architecture ready for documentation, presentations, or just to admire your hard work. It’s a lifesaver for onboarding new developers like me or debugging complex relationships. #Django #Python #WebDevelopment #Backend #CodingTips #SoftwareArchitecture #DatabaseDesign
To view or add a comment, sign in
-
-
I wrote a JSONc formatter in Rust. It's basically just a clone of "fracturedJSON". JSONc is a variant of JSON that is commonly used for config files. It supports comments and trailing commas, unlike standard JSON. Anyhoo, my formatter renders this JSONc in a human-friendly way rather than what you'd see out of jq or python -m json.tool.
To view or add a comment, sign in
-
Day 2 – Grocery Store Practice Project (FastAPI) Today was all about connecting my project with a real database and understanding how backend systems actually manage data. What I worked on today: - Connected SQLite database with my FastAPI project - Configured SQLAlchemy engine and session - Created a Base model for defining database tables - Implemented a database connection dependency using FastAPI - Created models for: - Product - Product Category - Product Image - Generated database tables from these models What I learned today: - What ORM (Object Relational Mapping) is and why it simplifies database interaction - How SQLAlchemy helps convert Python classes into database tables - How database session lifecycle works (open → use → close) - How FastAPI manages database connections efficiently using dependency injection - Step by step, I’m building a strong understanding of backend development and how real-world applications handle data behind the scenes. Excited to move forward and implement CRUD operations next. Here is My Github Project Repository: https://lnkd.in/dhmP-BeX #FastAPI #Python #BackendDevelopment #SQLAlchemy #SQLite #WebDevelopment #LearningJourney #Day2 #PracticeProject
To view or add a comment, sign in
-
I'm often asked how to handle edge cases when building data layers with MongoDB and Python. Simple CRUD is great, but real-world apps need robust query patterns and clean architecture. Working in VS Code on this project, I focused on layering logic. Instead of calling the database directly from the application layer, I used a modular service pattern (like user_service.py calling db_utils.py). A few key practices I implemented: ✅ Robust Error Handling: Ensuring a clean return for cases like invalid ObjectIds, which prevents app crashes. ✅ Modular Query Logic: Abstracting queries into specific, reusable functions (e.g., get_users_by_college) makes the main logic much easier to read and test. ✅ Automated Postman-Free Testing: In my terminal, you can see I'm using curl and echo to script a "Full CRUD Test Cycle." This is a fast, reproducible way to verify APIs during development. What's your go-to pattern for structuring database interactions in your applications? Do you stick with raw queries, ORMs, or custom data access objects? Let me know in the comments! GitHub link - > https://lnkd.in/dASzkj7T #mongodb #python #development #dataservices #vscode #backend #programming #softwareengineering
To view or add a comment, sign in
-
-
If you're a Claude Code user, check out these terminal tools! Glad to see Starship and CShip getting the love they deserve!
Claude Code has pulled me back into the terminal full-time. These are the top tools for productivity boost in your terminal: 1. 𝐅𝐢𝐬𝐡 𝐬𝐡𝐞𝐥𝐥 → An alternative to zsh and bash with autocomplete for commands, options, flags, and git branches → Syntax highlighting: immediately shows you if a command is valid or not → Automatically activates Python virtual environments https://fishshell.com/ 2. 𝐒𝐭𝐚𝐫𝐬𝐡𝐢𝐩 → A fully customizable prompt → Shows your current folder, git branch, active Python/TS environment at a glance https://starship.rs/ 3. 𝐂𝐬𝐡𝐢𝐩 (𝐒𝐭𝐚𝐫𝐬𝐡𝐢𝐩 𝐟𝐨𝐫 𝐂𝐥𝐚𝐮𝐝𝐞 𝐂𝐨𝐝𝐞) → Brings Starship-level customization to the Claude Code status line → By default the status line is very barebones → Cship adds information on token usage, when your window resets, all in a customizable way. https://cship.dev/ 4. 𝐘𝐚𝐳𝐢 → A graphical file manager that runs inside your terminal → Replaces the ls and cd loop with a fast, visual interface → Shows a preview of every file (code, images, even PDFs) https://lnkd.in/ePcegMWA 5. 𝐑𝐢𝐩𝐠𝐫𝐞𝐩 → Search your codebase for regex patterns faster than grep → Respects .gitignore, so no false positives in your .venv or node_modules folders 6. 𝐀𝐭𝐮𝐢𝐧 → Replaces Ctrl+R with a searchable, filterable history across sessions → Super useful when you need to find that command you ran two weeks ago → Allows syncing across machines. Searching for that command you run on your other computer? https://atuin.sh/ Are you using these? What else should I add to this list? I write about data & AI every week. Subscribe to my newsletter to get each one in your inbox 👉 https://lnkd.in/echQG4Zu
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