Ask HN: How to limit my web app to a particular city?

1 points by oliv__ ↗ HN
Hello HN,

I am building a web app (with Django as a backend) where users can create objects with a "where" field that is meant to inform other users viewing the object of its location. Right now, it is a simple dumb text field, so there is no "geo-validation" of the input.

For the launch, I'd like to limit the creation of objects to a certain city. How could I do so and what do you think would be the best/simplest way?

I've thought of a) setting up city-specific subdomains (like craigslist) or b) making that field "smart" so that it would "verify" the address given (like when you type in google maps) and then filter from there to only include addresses from a particular city, but the idea was to keep it simple and that seems like it would bring more problems in (what if the address is not recognized?).

If you have any thoughts or experience with this, I'd love to hear it. Thanks.

2 comments

[ 3.1 ms ] story [ 19.7 ms ] thread
I think your input should come with a map then. Integrate google maps into your application, then save the latitude and longitude values, then before saving the object, validate the address, if its not within the city then don't save it, flash a message.
Hi-- thanks for the answer, it seems a lot clearer now that you've written it down. I don't really have a need for the whole map though but if I could integrate a google maps powered input with suggestions, that would be ideal. Is that possible?