Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why Sweating the Details Matter: Flask, port 5000, localhost, Safari and macOS

Pop quiz : Suppose you are developing a Flask app. Flask uses port 5000 as its default port. Now suppose that you have your Flask app running on macOS on port 5000. You're testing in Safari 1 and you enter this URL into the address bar: http://localhost:5000 . Question : What will happen? Answer : You won't get your Flask app. Instead, you'll likely get a whole lot of nothing, which can be very…

Developing a Flask app involves running it on a specific port, typically port 5000, which can lead to confusion when testing in Safari on macOS. This is because port 5000 is also the default port for AirPlay, potentially causing conflicts. However, this is not the primary issue.

The real problem lies in how localhost resolves to an address. Contrary to popular belief, localhost does not necessarily resolve to 127.0.0.1. Instead, macOS prefers IPv6 and will resolve localhost to ::1, an IPv6 address. This means that when you enter http://localhost:5000 in Safari, you may not see your Flask app, as the server might be bound to ::1:5000, where AirPlay is running.

To access your Flask app, you should use http://127.0.0.1:5000. This works because Flask's development server binds to 127.0.0.1 (IPv4 loopback), not ::1. Thus, sweating the details of ports, addresses, and sockets is crucial to ensure your Flask app runs smoothly.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Stop Choosing Between BM25 and Vector Search: Implement Hybrid Search with RRF

Combine dense embeddings and sparse keyword search using Reciprocal Rank Fusion to eliminate retrieval failure modes in production RAG systems.

  • Hybrid search combines BM25 and vector search to avoid blind spots
  • Reciprocal Rank Fusion merges ranked outputs without score normalization
  • Implementation uses rankbm25 and sentencetransformers libraries

New York City 911 System Missed 1,700 Calls Due To Software Update

Longtime Slashdot reader belmolis writes: Part of New York City's 911 emergency system was offline from about 3:13 a.m. to 10 a.m. on August 18th due to a software update, according to Medical Daily.

  • Software update caused 1,700 unanswered 911 calls in NYC on August 18th
  • Calls made to Bronx center, 400 direct callers didn't receive help
  • NYC didn't inform public, disclosed info upon journalist request

More from Friday 28 August →