Skip to content
Sign upLog in
← Back to Community

Banning IPs in Flask bans all not one

Profile icon
PotatoWatch

I tried to make a ip banner for a flask website and took a little bit from this SO question and this other SO question (both of which are over 7 years old). Problem is, after I ban myself, I attempted to access the website through another computer and found that it was also banned. What am I doing wrong?

Answered by ch1ck3n [earned 5 cycles]
View Answer
Voters
Profile icon
PotatoWatch
Comments
hotnewtop
Profile icon
ch1ck3n

all requests are routed to one server therefore all ips are the same in replit so you can't do IP banning in replit

Profile icon
PotatoWatch

@ch1ck3n
darnit

Profile icon
bravebrowseradm

You simply need to use request.access_route[0] to retrieve the origin ip. This works via replit, cloudflare and other proxies.