0Pricing
Flask Academy · Lesson

Why Not the Built-in Dev Server

Production needs a real WSGI server.

Why Not the Built-in Dev Server is a free Flask Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Flask Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Server That Got You Here

When you ran flask run, Flask started a tiny built-in server. It was perfect for learning, but it was never meant to face real users. 🚦

It Says So Itself

Notice the warning Flask prints on startup. It literally tells you this is a development server and not for production traffic.

WARNING: This is a development server.
Do not use it in a production deployment.

One Request at a Time

By default the dev server is largely single-threaded. One slow request can make every other visitor sit and wait their turn.

No Real Concurrency

Real sites handle many users at once. The dev server has no proper worker model to spread that load across CPU cores.

Not Built for Hostile Input

The dev server is not hardened for the open internet. Its weak security posture makes it an easy target for malformed or malicious requests.

It Crashes Loudly

In debug mode an error can dump a full traceback straight to the browser. Handy for you, but a gift to attackers in production.

Enter WSGI

Python web apps talk to servers through a contract called WSGI. Flask speaks it, so any compliant server can run your app.

What a Real Server Adds

A production WSGI server brings many workers, restarts on crashes, and tuned timeouts. It is built to stay up under pressure.

Your App Barely Changes

The good news: your views stay the same. You just point a production server at your app object instead of calling flask run.

# wsgi.py
from myapp import app  # the WSGI callable

Meet the Gunicorn Plan

For the rest of this course you will serve Flask with Gunicorn, a battle-tested WSGI server, then wrap it in Docker.

Dev Server Still Has a Job

None of this means deleting flask run. Keep using the dev server locally for its instant reloader and friendly errors.

Quick Check

Why should you avoid the built-in server in production?

Recap

The dev server is for learning, not launching. For production you hand your WSGI app to a real server like Gunicorn. Next up: doing exactly that. 🚀

Frequently asked questions

Is the “Why Not the Built-in Dev Server” lesson free?

Yes — the full text of “Why Not the Built-in Dev Server” is free to read here on the web, and the Flask Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Flask Academy course, upgrade to CoddyKit PRO.

What will I learn in “Why Not the Built-in Dev Server”?

Production needs a real WSGI server. You practise Flask Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Flask Academy?

No prior experience is required. Flask Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Why Not the Built-in Dev Server” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Flask Academy lesson?

Yes. Every Flask Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Not the Built-in Dev Server
  2. Run Flask Under Gunicorn
  3. Write a Production Dockerfile
  4. Front It with Nginx and Compose
← Back to Flask Academy