Closed
Bug 774746
Opened 13 years ago
Closed 13 years ago
Add geolocation to the marketplace
Categories
(Marketplace Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2012-09-13
People
(Reporter: clouserw, Assigned: jrconlin)
References
Details
This bug was originally born out of bug 763682 but the geolocation was split out since it made things more complicated. See that bug for patches surrounding this.
We'd like to be able to point people to the best regional store for their location. The place to do it in the code is https://github.com/mozilla/zamboni/blob/master/mkt/site/middleware.py#L139 and we're looking for something like:
> # What store are you in?
> if cookies[store] and store_is_valid(cookies[store]):
> store = cookies[store]
> else
> store = geolocate_user()
> cookies[store] = store
The magic here is geolocate_user(). Thus far at Mozilla our geolocation solution is a binary database file. We put a constant in our settings file to point to a file on disk so we don't have to check it in to the repo. You can get a free demo file here (http://www.maxmind.com/app/geolite). We also own (purchased) the full file and once we deploy we'll flip to using that. Anyway, MaxMind has a library for python (http://www.maxmind.com/app/python) which sounds like a pain in the ass, but they also link to https://github.com/appliedsec/pygeoip which sounds way friendlier for deployment (pure python). Cvan also points out https://docs.djangoproject.com/en/1.3/ref/contrib/gis/geoip/ which likely trumps them all. Please evaluate and use a technology that gets us geolocation in a maintainable and reliable way. :)
Once you have a response from the geo-ip db check if the store exists on marketplace, otherwise they are sent to the generic store.
* The full geoip db is a few hundred MB. Yeah, I'm not excited about opening that file for every visitor to the store either but metrics says that it is very fast lookups. The MMAP_CACHE flag when opening it will let us not load the whole thing into memory which I think will work for us. If not, we can experiment but this is a place to start.
Spec: https://wiki.mozilla.org/Marketplace/Features/Country_Stores
Reporter | ||
Updated•13 years ago
|
Assignee: nobody → jrconlin
Assignee | ||
Updated•13 years ago
|
Target Milestone: --- → 2012-08-09
Reporter | ||
Comment 1•13 years ago
|
||
Hoping to have something by today, but kicking to next week
Target Milestone: 2012-08-09 → 2012-08-16
Assignee | ||
Comment 2•13 years ago
|
||
Fix staged at https://github.com/jrconlin/zamboni/tree/774746-dat.1
With new dependency on https://github.com/jrconlin/geoip_server
waiting for ops confirmation on packaging before sending pull request.
Reporter | ||
Comment 3•13 years ago
|
||
CCing IT - please reply asap.
Reporter | ||
Comment 4•13 years ago
|
||
I filed an IT bug, marking dependent.
Depends on: 785420
Target Milestone: 2012-08-16 → ---
Reporter | ||
Updated•13 years ago
|
Target Milestone: --- → 2012-09-06
Reporter | ||
Comment 5•13 years ago
|
||
Still waiting on IT. Bumping again.
Target Milestone: 2012-09-06 → 2012-09-13
Comment 6•13 years ago
|
||
(In reply to Wil Clouser [:clouserw] from comment #5)
> Still waiting on IT. Bumping again.
Are we still blocked by anything here?
Reporter | ||
Comment 8•13 years ago
|
||
(In reply to Chris Van Wiemeersch [:cvan] from comment #7)
> Is this blocked on bug 793396?
No. Geolocation is ready to go. Bug 794616 is filed for putting daemons in production. I'm closing this bug for verification.
You need to log in
before you can comment on or make changes to this bug.
Description
•