Day 69 of #100DaysOfCode — and today was a BIG one! 🔐🚀 I built a full authentication & authorization system into my Flask blog app completely from scratch. Here's what went into it: 🔓 𝗔𝘂𝘁𝗵𝗲𝗻𝘁𝗶𝗰𝗮𝘁𝗶𝗼𝗻 ✨ User registration & login with Flask-Login 🔒 Password hashing & salting with Werkzeug ⚠️ Duplicate email detection with flash messaging 👁️ Dynamic navbar toggling based on login state 🛡️ 𝗔𝘂𝘁𝗵𝗼𝗿𝗶𝘇𝗮𝘁𝗶𝗼𝗻 👷 Built a custom @admin_only Python decorator using functools.wraps 🚫 Admin-only routes return HTTP 403 for unauthorized users 👀 UI buttons hidden in templates using current_user.id checks 🗄️ 𝗥𝗲𝗹𝗮𝘁𝗶𝗼𝗻𝗮𝗹 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲 𝗗𝗲𝘀𝗶𝗴𝗻 🔗 One-to-Many: User → BlogPost 🔗 One-to-Many: User → Comment 🔗 One-to-Many: BlogPost → Comment ⚙️ SQLAlchemy relationships with back_populates & cascade deletes 💬 𝗖𝗼𝗺𝗺𝗲𝗻𝘁𝘀 & 𝗣𝗿𝗼𝗳𝗶𝗹𝗲 𝗣𝗶𝗰𝘁𝘂𝗿𝗲𝘀 ✏️ CKEditor-powered rich text comment form 👤 Gravatar integration using hashlib MD5 — zero external packages needed 🎭 Every commenter gets a unique identicon avatar automatically 💡 Key 𝗹𝗲𝘀𝘀𝗼𝗻𝘀: 🚨 Database schema decisions have real consequences — we rebuilt the DB twice as the schema evolved. In production you'd need proper migrations. Flask-Migrate is going on the list! 💥 Learned the hard way about cascade deletes — SQLAlchemy refuses to delete a parent record if children exist and constraints aren't set. One line of code fixes everything: cascade="all, delete-orphan" 31 days to go and the app is starting to feel like a real product! 💪🔥 #Python #Flask #WebDevelopment #SQLAlchemy #FlaskLogin #100DaysOfCode #LearningInPublic #BackendDevelopment #CodingJourney
More Relevant Posts
-
DAY 5 - THE TECH STACK (Tools & Why I Chose Them) Every tool in my stack was a deliberate choice. Here's why - and what I'd tell my past self about each one. No random picks. No "I've always used this." Every decision had a reason. > Python :Primary language for the crawler and extraction logic. Chose it for its rich ecosystem - BeautifulSoup, Playwright, asyncio - nothing else comes close for this use case. Wish I knew: Async Python has footguns. Mixing sync and async code will ruin your day silently. > Playwright (Headless Browser) : Handles JS-rendered pages that raw HTTP requests miss completely. Chose it over Puppeteer for Python-native support and better async handling. Wish I knew: Resource usage adds up fast at scale. Spin up only what you need. > Message Queue (e.g., Redis / RabbitMQ) : Acts as the backbone between crawlers and processors - total decoupling. Chose it because I needed workers to fail independently without cascading crashes. Wish I knew: Queue monitoring is not optional. A silent backlog will sneak up on you. > Database (Structured Storage) : Stores normalized technographic profiles per company, queryable and enriched. Chose a relational model to keep tech profiles structured and joinable. Wish I knew: Schema design early saves migrations later. Do not skip this. > Docker: Containerized each service so workers can be spun up and torn down without friction. Chose it for portability and reproducibility across environments. Wish I knew: Docker networking between containers is its own learning curve. Start simple. Which tool here are you most curious about? Happy to go deeper on any of them 👇 #TechStack #Python #DistributedSystems #WebScraping #BackendDevelopment
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
-
🚀 I just shipped something I wish existed years ago. Introducing app-generator-cli — a developer-friendly CLI to scaffold production-ready Python projects in seconds. Tired of copy-pasting boilerplate every time I started a new project, I built a tool that gets you from zero to a clean, working codebase with a single command: app-generator-cli create fastapi my_api --docker --postgres --redis What it scaffolds for you: ✅ FastAPI backend with async DB session, Pydantic settings & health checks ✅ FastAPI + Jinja2 full-stack app with templated frontend ✅ LangChain / LangGraph AI apps with a ReAct agent, RAG chain & tool registry ✅ Optional Docker, PostgreSQL, Redis — all wired up out of the box ✅ uv-powered dependency bootstrapping (blazing fast) ✅ Tests, .env setup, and clean project structure included No more spending the first hour of a project configuring folders. Just build. 🔗 GitHub: https://lnkd.in/dM4yrsEp 📦 PyPI: pip install app-generator-cli If you work with FastAPI, LangChain, or LangGraph — give it a try and let me know what you think! Stars and feedback are always welcome ⭐ #Python #FastAPI #LangChain #LangGraph #OpenSource #DeveloperTools #CLI #uv #BuildInPublic
To view or add a comment, sign in
-
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
-
Your API isn’t slow — your pagination might be. 📉 It worked perfectly… until your data grew. Then every page got slower than the last. Your code didn’t change. But your dataset did. The culprit? Offset pagination. The deeper the page, the more rows your database has to scan and skip. Page 1 → fast Page 1000 → painful Same query shape. Very different cost. The fix isn’t always caching. Sometimes it’s changing the pattern. Switch to cursor-based pagination. No skipping. Just seeking. In Django REST Framework: Use *CursorPagination* instead of *PageNumberPagination*. Performance stays consistent — even at scale. Because most performance issues aren’t complex. They’re patterns that don’t scale. And most developers don’t notice… until production. #BackendDevelopment #Django #Python #WebDevelopment #SoftwareEngineering #APIPerformance #DatabaseOptimization #SystemDesign #ScalableSystems #DjangoRESTFramework
To view or add a comment, sign in
-
-
Day 7 of My Full Stack Journey! 🚀 Today was all about Django Models & Databases — and it was a big day! Here's what I covered: 🔹 Created Django Models with fields like CharField, IntegerField, EmailField & BooleanField 🔹 Ran Migrations and explored the SQLite Database visually 🔹 Set up Django Admin Panel & created a Superuser 🔹 Registered Models in Admin and managed data through GUI 🔹 Used Django ORM — all(), filter(), get(), create(), update(), delete() 🔹 Built 2 complete models — Student & Book — independently! 🔹 Learned 3 ways to add data: Admin Panel (GUI) Django Shell (Python) DB Shell (SQL) The biggest insight today — ORM eliminates the need to write raw SQL. Python directly talks to the database! 🤯 Consistency > Motivation. Showing up every day is the real skill! 💪 Next up → HTML Forms in Django! 🎯 #Django #Python #FullStackDevelopment #100DaysOfCode #WebDevelopment #LearningInPublic #Day7
To view or add a comment, sign in
-
-
🛠️ #PythonJourney | Day 144 — Deep Dive: Fixing & Structuring the URL Shortener After starting the URL Shortener project yesterday, today I went deep into code review and debugging. Key work done: ✅ Analyzed main.py line by line ✅ Fixed 8 critical errors: • Missing imports (datetime, UUID, Request) • Type hint mistakes (Optinal → Optional) • Union syntax compatibility (| → Optional[]) • Undefined dependencies (get_db, get_current_user) ✅ Created database.py with: • PostgreSQL connection management • SQLAlchemy SessionLocal factory • Connection pooling configured This is exactly what real backend development looks like: not just writing code, but understanding what works and what doesn't. Debugging and fixing issues teaches way more than following tutorials. The project structure is now solid: - app/main.py (API endpoints) - app/database.py (DB config) - docker-compose.yml (local services) Next: create models.py and write tests. #Python #FastAPI #PostgreSQL #Debugging #BackendDevelopment #CodeReview #SoftwareEngineering
To view or add a comment, sign in
-
-
Day 62 of #90DaysOfCode Today I upgraded my Flask blog from a static HTML blog into a dynamic blog powered by an external API. Previously, blog posts were written directly inside HTML templates. In this version, the application fetches blog data from an API and renders it dynamically using Flask and Jinja templates. What changed in the application • Connected the Flask app to an external API • Processed JSON data inside Flask • Passed backend data to templates • Used Jinja loops to dynamically render blog posts • Implemented dynamic routes for individual blog pages Now each blog post loads through a dynamic URL and renders its own page, making the application behave more like a real blog platform. Key concepts explored • API integration • JSON data handling • Dynamic routing in Flask • Jinja templating GitHub Repository https://lnkd.in/gceS7shg #Python #Flask #BackendDevelopment #WebDevelopment #SoftwareEngineering #90DaysOfCode
To view or add a comment, sign in
-
Just deployed my first data app and honestly it felt like a whole journey 🚀 I built a Product Information Quality Dashboard using Python and Streamlit that analyzes how complete product data is and flags items that might confuse customers. Some of the skills I got to work with: 🐍 Python 🗄️ SQLAlchemy & SQLite for database management 📊 Pandas for data handling and exports ⚙️ Streamlit for building the interactive dashboard 🔧 Git & GitHub for version control ☁️ Deployed live on Streamlit Community Cloud Still learning and building every day — but seeing something you built actually live on the internet hits different 💪 Feedback always welcome! Check it out 👇 🔗 Live App: https://lnkd.in/gaiu6Src 💻 GitHub: https://lnkd.in/gm-TeghV #Python #DataScience #Streamlit #buildinpublic #DataAnalytics #LearningInPublic
To view or add a comment, sign in
-
-
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
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