A FastAPI/Flask recipe that turns IP traits into an allow / verify / review decision, without locking out real users.
Why hard-blocking VPN users backfires
Plenty of legitimate people sign up from a VPN, a privacy relay or a phone on a mobile carrier network. Block them outright and you lose real customers while determined abusers just switch IPs. A better pattern: treat the IP as a risk signal , add friction (email verification, CAPTCHA, manual review) when signals stack up, and keep the reasons on the user record so you can tune later.
Get the real client IP in FastAPI or Flask
Behind Nginx or a load balancer, the socket address is your proxy.…