惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
D
DataBreaches.Net
J
Java Code Geeks
月光博客
月光博客
MyScale Blog
MyScale Blog
博客园 - Franky
Jina AI
Jina AI
量子位
博客园 - 聂微东
博客园 - 叶小钗
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园 - 【当耐特】
Blog — PlanetScale
Blog — PlanetScale
I
InfoQ
小众软件
小众软件
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
博客园_首页

alexwlchan’s notes

What is WS11 1DB? Blocking referrers with Caddy How to type a Spanish question mark (¿) on a Mac Non-overlapping type comparisons and Python type checkers Why does t.Setenv panic after t.Parallel? Use Path.glob() and Path.rglob() for typed versions of glob.glob() Curious clocks and colourful eyes Track which templates are used by Jinja2 Archeologists distinguish between “sherds” and “shards” A single command to test all my changed Go packages Disable the new message animations in WhatsApp Finding high-churn folders that bother Backblaze Always-on SSH agent forwarding with my Git pushes Managing the caption of a photo with AppleScript (but not PhotoKit) Goodhart’s and Campbell’s Law are different Notes from The Cornishman No. 176 (Spring 2026) Notes from The Cornishman No. 176 (Spring 2026) GitUp can’t diff text files larger than 8MB Home Testing the width of a page on a mobile device using Playwright Disable AirPods charging notifications Start a Caddy server in a subprocess during a Python session Filter a list of JSON object based on a list of tags HOME_GET_ME_HOME is a Citymapper Shortcuts action The FileExistsError exception exposes a filename attribute The red-lined bubble snail Why can’t Python connect to example.com? Useful type hints for Python How to truncate the middle of long command output What’s the main prefix in SQLite queries?
AirPlay Receiver can interfere with Flask apps
2026-03-18 · via alexwlchan’s notes

It listens on port 5000, which is the default port used for running Flask apps in debug mode, then Safari sends blank pages for my Flask app.

One persistent issue I have when developing apps with Flask is that I’ll go through several rounds of iteration, run the app with the debug server, and at some point Safari will stop loading the app. If I try to load the app in Safari, I just get blank pages. Other browsers are fine, but Safari is broken until I restart it.

I hadn’t spotted the pattern, but today Brian explained what’s going on: the default port for the Flask dev server is port 5000, and my Mac is listening on port 5000 for AirPlay. If I run the dev server with the default port, at some point Safari connects to the AirPlay Server instead of my app, and then it starts receiving blank pages.

There are three workarounds:

  1. Use a different port to run my Flask apps.

  2. Set the FLASK_RUN_PORT in my shell config to override the default Flask port (h/t James).

  3. Disable AirPlay Receiver in Settings: General > AirDrop & Handoff > AirPlay Receiver.

I’ve done (3), because I never need to AirPlay to my Macs.

This isn’t the first time I’ve had to disable a setting in the “AirDrop & Handoff” screen.