🔄 flo. v2 — From Frontend Project to Full-Stack Application A few weeks ago I shipped flo., a personal finance manager built with Angular and Supabase. The reception was encouraging. So I took it further. I've spent the last several days building and deploying a production Django REST Framework backend — and the deployment process alone taught me more than I expected. Here's an honest breakdown of what went wrong and what I learned: ⚙️ The Technical Challenges → Managing a monorepo with Angular frontend and Django backend in the same repository — and understanding how deployment platforms interpret your folder structure → Python version compatibility: Render defaulted to Python 3.14, which broke psycopg2. The fix was a single runtime.txt file — but finding that root cause took hours → Production vs. development Django: STATIC_ROOT, whitenoise middleware, gunicorn, environment variables — none of this exists in a local setup → Database configuration: migrating from localhost to a cloud PostgreSQL instance and understanding how DATABASE_URL works in production → Build pipeline isolation: when your repo contains two projects, deployment platforms need to be explicitly told which one to build 🏗️ What Was Actually Built → Django 4.2 REST API with JWT authentication → PostgreSQL database hosted on Render → Static file serving via Whitenoise → Environment-based configuration for local and production environments → Proper separation of build and start commands 📌 The Bigger Lesson Every deployment error was a gap in my mental model of how production systems work. Fixing them didn't just solve the immediate problem — it built intuition that tutorials rarely provide. The gap between "it works locally" and "it works in production" is where real backend knowledge lives. 💻 GitHub: https://lnkd.in/dffqYfvM Always building. Always learning. #Django #Python #WebDevelopment #Backend #SoftwareEngineering #BuildInPublic #LearnInPublic #FullStack
Django Backend Development Challenges and Lessons Learned
More Relevant Posts
-
From an optimization standpoint, most Django projects fail before they even start. Not because of bad code. Because of infrastructure entropy. 37% of developer time on new projects goes to setup: security configs, CI/CD wiring, deployment targets, boilerplate nobody wants to write. None of it is the actual product. So I trained my engineering instinct on this problem and shipped a solution: 47-Starter-Django — a production-grade Django template that pre-solves the entire infrastructure layer. What the system includes: ⚡ GitHub Actions CI/CD pipeline, pre-wired 🔐 Gitleaks security scanning, integrated from day zero 🚀 Multi-platform deployment: Vercel, Netlify, Firebase, GitHub Pages 📐 Design token architecture baked in 🤖 24/7 autonomous evolution system enabled The emergent behavior: you ship logic, not infrastructure. Every project starts at production readiness — not zero. The cognitive load of "how do I set this up?" collapses to zero. This is what building with leverage looks like. 🔗 https://lnkd.in/dQyrB_Yq #Django #Python #OpenSource #DevOps #CICD #BackendDevelopment #SoftwareEngineering #BuildInPublic #DeveloperTools #100DaysOfCode
To view or add a comment, sign in
-
Your Django endpoint is slow. There are no errors, and nothing obvious stands out in the logs. Even average response times can look fine. But one request is quietly running hundreds of small queries and dragging everything down. That’s what makes this hard to spot. In this post, Jaume Boguñá shows how to trace a slow request with AppSignal and fix it once and for all👇 https://lnkd.in/e-6iCZZt
To view or add a comment, sign in
-
One subtle thing I’ve noticed while working across backend frameworks: URL trailing slashes. In many Django / Django REST Framework projects, endpoints often look like: "/api/users/" While in FastAPI, Flask, Express.js, or Spring Boot, it’s more common to see: "/api/users" This usually comes down to framework defaults and conventions — not a major technical rule. Django historically favors trailing slashes. With settings like "APPEND_SLASH=True", if someone requests: "/api/users" Django may redirect it to: "/api/users/" So even if teams want clean URLs, redirects can still appear depending on project settings. Many modern teams prefer no trailing slash because: • Cleaner URLs • Fewer redirects • Simpler client behavior But in production systems, the bigger question isn’t style. It’s consistency. Good API design is usually about: • Predictable routing • Stable client integrations • Minimal surprises • Clear versioning • Team-wide standards Small details like this often reveal how framework philosophy shapes developer experience. What does your team prefer: Trailing slash or no trailing slash? #Django #Python #FastAPI #BackendDevelopment #RESTAPI #WebDevelopment #SoftwareEngineering #APIDesign
To view or add a comment, sign in
-
-
🚨 Debugging Story: When “Everything is Running” but Nothing Works Yesterday I ran into a tricky issue in one of our projects using Nginx + React + Django + PostgreSQL. Everything looked perfectly fine: ✔️ Nginx running ✔️ UI loading ✔️ Backend “running” ✔️ Database connected But the moment I tried to log in… 💥 502 Bad Gateway 🔍 What made it confusing? • Nginx config looked correct • Backend service appeared to be running • No obvious errors in logs • No request was even reaching Django At this point, it felt like a routing issue. 🧠 What actually went wrong? After digging deeper, I checked running processes: 👉 There were more Python processes active on the system than expected. What likely happened: • A Django server was started earlier • The IDE was closed, but the process kept running in the background • A new backend instance was started again • Result: stale/zombie processes holding the port or breaking the server state So even though the backend looked “running” — it wasn’t healthy or reachable ⚡ The fix • Killed all Python processes • Restarted the backend cleanly 👉 Everything started working instantly 💡 Key Learning “Running” does NOT mean “Working” A service can: Be active in the system ❌ But not accepting connections ❌ Or not responding properly ❌ And that’s enough for Nginx to return 502 Bad Gateway 🛠️ How to avoid this ✅ Always check if the port is already in use ✅ Avoid relying on Django dev server for long-running setups ✅ Use production-grade servers like Waitress or Gunicorn ✅ Be cautious when restarting services — especially after closing IDEs ✅ Add simple health-check endpoints to verify backend responsiveness Next time you see a 502 error, don’t just ask: ❌ “Is the service running?” Ask instead: ✔️ “Is the service actually reachable and healthy?” #Debugging #Django #Nginx #BackendDevelopment #SoftwareEngineering #DevOps #LearningMoment #cfbr
To view or add a comment, sign in
-
-
𝐌𝐨𝐝𝐞𝐫𝐧 𝐚𝐩𝐩𝐬 𝐝𝐨𝐧'𝐭 𝐣𝐮𝐬𝐭 𝐬𝐞𝐫𝐯𝐞 𝐇𝐓𝐌𝐋. 𝐓𝐡𝐞𝐲 𝐬𝐞𝐫𝐯𝐞 𝐝𝐚𝐭𝐚. Enter Django REST Framework, the most popular way to build APIs with Django. DRF (as everyone calls it) sits on top of Django and gives you everything you need to build clean, well-structured REST APIs. Here's what it brings to the table: 📦 𝐒𝐞𝐫𝐢𝐚𝐥𝐢𝐳𝐞𝐫𝐬: Convert your Django models to JSON (and back). They also handle validation, so your API rejects bad data automatically. 🔀 𝐕𝐢𝐞𝐰𝐒𝐞𝐭𝐬: Combine all CRUD operations into a single class. List, Create, Retrieve, Update, Delete — all in one place. 🛣️ 𝐑𝐨𝐮𝐭𝐞𝐫𝐬: Auto-generate URL patterns for your ViewSets. Less boilerplate, more shipping. 🔐 𝐀𝐮𝐭𝐡𝐞𝐧𝐭𝐢𝐜𝐚𝐭𝐢𝐨𝐧: Token auth, session auth, and JWT (via third-party packages) — all supported. 📖 𝐁𝐫𝐨𝐰𝐬𝐚𝐛𝐥𝐞 𝐀𝐏𝐈: A built-in web interface for testing your endpoints. Your API becomes self-documenting. I've used DRF extensively in building multi-department management systems. The combination of Django's ORM and DRF's serializers made complex nested data structures manageable and clean. Frontend devs love DRF because the API contracts are consistent. Backend devs love it because it removes repetition. If you're building anything with a frontend (React, mobile, anything), DRF is how Django talks to it. Tomorrow: Security in Django - what the framework protects you from by default. #Django #DRF #REST #API #BackendDevelopment #Python
To view or add a comment, sign in
-
-
Wheels 4.0 is on the way, and I've been updating the framework-comparison doc to show where it lands against Rails 8, Laravel 12, and Django 5. The short version: most of the rows that said "No" for CFWheels over the last five years now say "Yes" for Wheels 4.0. Bulk insert and upsert operations. Polymorphic associations. Advisory locks and pessimistic locking. A first-class middleware pipeline with built-in rate limiting and security headers. Browser testing via Playwright Java. Parallel test runner. HTTP integration test client. Multi-tenancy in-core rather than as a third-party package. The doc is honest about where Wheels still trails: ecosystem size is smaller, bidirectional WebSocket is deliberately not a goal (SSE is the cross-engine-uniform real-time primitive), and Vite asset-pipeline tooling is newer than Rails' or Laravel's equivalents. Worth a read if the last time you evaluated Wheels it did not meet the bar for what you needed. https://lnkd.in/g2K7Ktfb #CFML #Wheels #WebDevelopment #OpenSource
To view or add a comment, sign in
-
𝐆𝐞𝐭𝐭𝐢𝐧𝐠 𝐚 𝐃𝐣𝐚𝐧𝐠𝐨 𝐚𝐩𝐩 𝐫𝐮𝐧𝐧𝐢𝐧𝐠 𝐥𝐨𝐜𝐚𝐥𝐥𝐲 𝐢𝐬 𝐞𝐚𝐬𝐲. 𝐆𝐞𝐭𝐭𝐢𝐧𝐠 𝐢𝐭 𝐩𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧-𝐫𝐞𝐚𝐝𝐲 𝐢𝐬 𝐚 𝐝𝐢𝐟𝐟𝐞𝐫𝐞𝐧𝐭 𝐬𝐤𝐢𝐥𝐥 𝐞𝐧𝐭𝐢𝐫𝐞𝐥𝐲. Here's what the deployment process actually looks like and what nobody tells you when you start. ⚙️ 𝐒𝐞𝐭𝐭𝐢𝐧𝐠𝐬 𝐦𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭 Django has a settings.py that controls everything. In production, you split this into base, development, and production configs. Secrets go in environment variables — never in the codebase. 🗄️ 𝐃𝐚𝐭𝐚𝐛𝐚𝐬𝐞 SQLite works for development. Production means PostgreSQL or MySQL, connection pooling, and proper backup strategies. I've run Postgres, MySQL, and Oracle 19c in production environments. 📁 𝐒𝐭𝐚𝐭𝐢𝐜 & 𝐦𝐞𝐝𝐢𝐚 𝐟𝐢𝐥𝐞𝐬 Django's dev server handles static files. In production? That's Nginx or a CDN's job. You run collectstatic once and point your web server at the output directory. 🚀 𝐖𝐒𝐆𝐈 / 𝐀𝐒𝐆𝐈 𝐒𝐞𝐫𝐯𝐞𝐫 Django doesn't serve requests directly in production. Gunicorn or uWSGI acts as the application server. Nginx sits in front and handles the heavy lifting. 🔁 𝐏𝐫𝐨𝐜𝐞𝐬𝐬 𝐦𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭 Systemd or Supervisor keeps your app running after crashes and server reboots. 📊 𝐋𝐨𝐠𝐠𝐢𝐧𝐠 & 𝐦𝐨𝐧𝐢𝐭𝐨𝐫𝐢𝐧𝐠 Set up structured logging. Use Sentry for error tracking. You want to know when things break before your users do. The deployment checklist Django provides (python manage.py check --deploy) is genuinely one of the most useful tools in the ecosystem. Run it. Fix everything it flags. Production is where your app earns its reputation. Take it seriously from day one. Tomorrow: wrapping up the series and what building real projects with Django actually taught me. #Django #Deployment #DevOps #Python #WebDevelopment #Production
To view or add a comment, sign in
-
-
Excited to share something I’ve been working on! I’ve officially published my first Django utility package on PyPI: django-migration-testgen (v0.1.0). As a developer, I’ve always felt that Django migrations are powerful but often under-tested. In real-world projects, especially in large teams and production systems, migrations can silently break things if not properly validated. That’s where this tool comes in. What does it do? It automatically scans your Django apps and generates ready-to-use test files for your migration files, allowing you to confidently verify schema changes, both forward and backward. Why I built this: - Writing migration tests manually is repetitive and often skipped - Migration issues can break production deployments - CI pipelines should validate schema evolution, not just code Key Features: - Auto-discovers all migration files across apps - Generates structured test files per migration - Uses Django’s MigrationExecutor for real execution testing - Supports forward and rollback testing - Dry-run, force overwrite, and custom output directory support - Easy integration into CI/CD pipelines Install & try it: ```bash pip install django-migration-testgen ``` Then just run: ```bash python manage.py generate_migration_tests ``` My goal with this project is simple: make migration testing effortless, scalable, and reliable for Django developers. This is just v0.1.0, and I’m planning to improve it further with smarter test generation, better customization, performance optimizations, and community feedback. If you’re working with Django, I’d love for you to try it out and share your thoughts. Open to feedback, suggestions, and contributions. #Django #Python #OpenSource #SoftwareEngineering #BackendDevelopment #CI #DevOps #Testing #Programming
To view or add a comment, sign in
-
Everyone talks about routes in Express. Nobody talks enough about 𝐦𝐢𝐝𝐝𝐥𝐞𝐰𝐚𝐫𝐞. Middleware is what runs 𝐛𝐞𝐭𝐰𝐞𝐞𝐧 the request arriving and your response going back. It's not magic. It's just a function with three parameters: `req`, `res`, and `next`. Call `next()` and the request moves forward. Don't call it, and it stops right there. That one idea powers everything: → `express.json()`: parses incoming JSON so your controller can read `req.body` → `cors()`: lets your React frontend talk to your Express backend without being blocked → `morgan()`: logs every request hitting your server, automatically → Auth middleware: checks the token before the request ever reaches your route → Error middleware: catches anything that breaks and sends a clean response The order matters more than most beginners realize. If you put your auth middleware after your route, it never runs. Middleware executes top to bottom, exactly as you write it. This is what I mean when I say Express gives you nothing by default — but gives you full control in return. You decide what runs, in what order, on which routes. Django handled most of this silently. Express makes you think about it explicitly. And honestly? Understanding it deeply makes you a better backend developer regardless of the framework. Still building. Still learning. 🚀 #NodeJS #ExpressJS #Middleware #Django #Python #JavaScript #WebDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
Switching a view to async def doesn't make it faster. It changes what it can do while waiting. Here's what actually happens: 1. A sync view runs in a thread. Django hands it the request, the view executes, the thread is occupied until it returns. 2. Under high concurrency, threads are the bottleneck. Each blocked thread holds a worker while waiting on I/O. 3. An async view runs in the event loop. While it waits on I/O operation, the event loop moves on to the next request. 4. No thread sitting idle. No worker blocked. Just the event loop cycling through work. The gain is concurrency under I/O wait and not raw speed! The Catch - - Complex QuerySets, transactions, and some aggregations have rough edges in async contexts. The ORM behaves in sync way in that case. - Signals are synchronous. Middleware is mostly synchronous in most production stacks. Async Django is not a drop-in performance upgrade. It's an architecture decision with specific prerequisites. Have you gone fully async in a Django project or hit a synchronous bottleneck that stopped the migration? #Python #Django #BackendDevelopment #SoftwareEngineering
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