Re: [Django] #19168: GeoIP does not work properly under os X

2013-05-10 Thread Django
#19168: GeoIP does not work properly under os X
--+-
 Reporter:  tejinderss@…  |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  GIS   |  Version:  1.4
 Severity:  Normal|   Resolution:  duplicate
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+-
Changes (by claudep):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 Fixed in #20384

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19168: GeoIP does not work properly under os X

2012-11-13 Thread Django
#19168: GeoIP does not work properly under os X
--+
 Reporter:  tejinderss@…  |Owner:  nobody
 Type:  Bug   |   Status:  reopened
Component:  GIS   |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by aaugustin):

 * stage:  Unreviewed => Accepted


Old description:

> django.contrib.gis.geoip.GeoIP does not read the city/country databases
> when called without any parameters. But when passing the city/country
> database files path explicitly to the init method, it works fine.
>
> Here is example:
> # Settings
> GEOIP_PATH = os.path.join(PROJECT_DIR, 'bin',
> 'GeoIP')
> GEOIP_COUNTRY  = 'GeoIP.dat'
> GEOIP_CITY  = 'GeoLiteCity.dat'
>
> In [1]: from django.contrib.gis.geoip import GeoIP
> In [2]: geo = GeoIP()
> In [3]: geo.info
> Out[3]: 'GeoIP Library:\n\t1.4.8\nCountry:\n\t\nCity:\n\t'
> In [4]: geo._city_file
> Out[4]:
> Path(u'/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat')
> In [5]: geo._country_file
> Out[5]: Path(u'/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat')
> In [6]: geo.city('8.8.8.8')
> Invalid database type GeoIP Country Edition, expected GeoIP City Edition,
> Rev 1
>
> Doing same thing passing the path as parameters:
>
> In [7]: geo =
> GeoIP(city='/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat',
> country='/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat')
> In [8]: geo.info
> Out[8]: 'GeoIP Library:\n\t1.4.8\nCountry:\n\tGEO-106FREE 20120207 Build
> 1 Copyright (c) 2011 MaxMind Inc All Rights Reserved\nCity:\n\tGEO-
> 533LITE 20121002 Build 1 Copyright (c) 2012 MaxMind Inc All Rights
> Reserved'
> In [9]: geo._city_file
> Out[9]: '/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat'
> In [10]: geo._country_file
> Out[10]: '/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat'
> In [11]: geo.city('8.8.8.8')
> Out[11]:
> {'area_code': 650,
>  'charset': 0,
>  'city': u'Mountain View',
>  'continent_code': u'NA',
>  'country_code': u'US',
>  'country_code3': u'USA',
>  'country_name': u'United States',
>  'dma_code': 807,
>  'latitude': 37.4192008972168,
>  'longitude': -122.05740356445312,
>  'postal_code': u'94043',
>  'region': u'CA'}
>
> This happens under ox X mountain lion and with kyngchaos gis/gdal binary
> packages as well as self compile brews.

New description:

 django.contrib.gis.geoip.GeoIP does not read the city/country databases
 when called without any parameters. But when passing the city/country
 database files path explicitly to the init method, it works fine.

 Here is example:
 {{{
 # Settings
 GEOIP_PATH = os.path.join(PROJECT_DIR, 'bin',
 'GeoIP')
 GEOIP_COUNTRY  = 'GeoIP.dat'
 GEOIP_CITY  = 'GeoLiteCity.dat'
 }}}

 {{{
 In [1]: from django.contrib.gis.geoip import GeoIP
 In [2]: geo = GeoIP()
 In [3]: geo.info
 Out[3]: 'GeoIP Library:\n\t1.4.8\nCountry:\n\t\nCity:\n\t'
 In [4]: geo._city_file
 Out[4]:
 Path(u'/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat')
 In [5]: geo._country_file
 Out[5]: Path(u'/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat')
 In [6]: geo.city('8.8.8.8')
 Invalid database type GeoIP Country Edition, expected GeoIP City Edition,
 Rev 1
 }}}

 Doing same thing passing the path as parameters:

 {{{
 In [7]: geo =
 GeoIP(city='/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat',
 country='/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat')
 In [8]: geo.info
 Out[8]: 'GeoIP Library:\n\t1.4.8\nCountry:\n\tGEO-106FREE 20120207 Build 1
 Copyright (c) 2011 MaxMind Inc All Rights Reserved\nCity:\n\tGEO-533LITE
 20121002 Build 1 Copyright (c) 2012 MaxMind Inc All Rights Reserved'
 In [9]: geo._city_file
 Out[9]: '/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat'
 In [10]: geo._country_file
 Out[10]: '/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat'
 In [11]: geo.city('8.8.8.8')
 Out[11]:
 {'area_code': 650,
  'charset': 0,
  'city': u'Mountain View',
  'continent_code': u'NA',
  'country_code': u'US',
  'country_code3': u'USA',
  'country_name': u'United States',
  'dma_code': 807,
  'latitude': 37.4192008972168,
  'longitude': -122.05740356445312,
  'postal_code': u'94043',
  'region': u'CA'}
 }}}

 This happens under ox X mountain lion and with kyngchaos gis/gdal binary
 packages as well as self compile brews.

--

Comment:

 Fixed formatting -- please use preview.

 If I understand correctly, the problem only occurs when `GEOIP_PATH` is a

Re: [Django] #19168: GeoIP does not work properly under os X

2012-10-23 Thread Django
#19168: GeoIP does not work properly under os X
--+--
 Reporter:  tejinderss@…  |Owner:  nobody
 Type:  Bug   |   Status:  reopened
Component:  GIS   |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--

Comment (by anonymous):

 If I add str to the GEOIP_PATH like this in settings:

 GEOIP_PATH = str(os.path.join(PROJECT_DIR, 'bin', 'GeoIP'))

 then it works fine. I am using:

 from unipath import FSPath as Path

 to manage paths.

 Same setup works fine under ubuntu linux without any change.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19168: GeoIP does not work properly under os X

2012-10-23 Thread Django
#19168: GeoIP does not work properly under os X
--+--
 Reporter:  tejinderss@…  |Owner:  nobody
 Type:  Bug   |   Status:  reopened
Component:  GIS   |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by tejinderss@…):

 * status:  closed => reopened
 * resolution:  invalid =>


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19168: GeoIP does not work properly under os X

2012-10-23 Thread Django
#19168: GeoIP does not work properly under os X
--+--
 Reporter:  tejinderss@…  |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  GIS   |  Version:  1.4
 Severity:  Normal|   Resolution:  invalid
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by tejinderss@…):

 * status:  new => closed
 * needs_docs:   => 0
 * resolution:   => invalid
 * needs_tests:   => 0
 * needs_better_patch:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #19168: GeoIP does not work properly under os X

2012-10-23 Thread Django
#19168: GeoIP does not work properly under os X
--+
 Reporter:  tejinderss@…  |  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  GIS   |Version:  1.4
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 django.contrib.gis.geoip.GeoIP does not read the city/country databases
 when called without any parameters. But when passing the city/country
 database files path explicitly to the init method, it works fine.

 Here is example:
 # Settings
 GEOIP_PATH = os.path.join(PROJECT_DIR, 'bin',
 'GeoIP')
 GEOIP_COUNTRY  = 'GeoIP.dat'
 GEOIP_CITY  = 'GeoLiteCity.dat'

 In [1]: from django.contrib.gis.geoip import GeoIP
 In [2]: geo = GeoIP()
 In [3]: geo.info
 Out[3]: 'GeoIP Library:\n\t1.4.8\nCountry:\n\t\nCity:\n\t'
 In [4]: geo._city_file
 Out[4]:
 Path(u'/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat')
 In [5]: geo._country_file
 Out[5]: Path(u'/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat')
 In [6]: geo.city('8.8.8.8')
 Invalid database type GeoIP Country Edition, expected GeoIP City Edition,
 Rev 1

 Doing same thing passing the path as parameters:

 In [7]: geo =
 GeoIP(city='/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat',
 country='/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat')
 In [8]: geo.info
 Out[8]: 'GeoIP Library:\n\t1.4.8\nCountry:\n\tGEO-106FREE 20120207 Build 1
 Copyright (c) 2011 MaxMind Inc All Rights Reserved\nCity:\n\tGEO-533LITE
 20121002 Build 1 Copyright (c) 2012 MaxMind Inc All Rights Reserved'
 In [9]: geo._city_file
 Out[9]: '/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoLiteCity.dat'
 In [10]: geo._country_file
 Out[10]: '/Users/tejindersingh/Projects/kyb/bin/GeoIP/GeoIP.dat'
 In [11]: geo.city('8.8.8.8')
 Out[11]:
 {'area_code': 650,
  'charset': 0,
  'city': u'Mountain View',
  'continent_code': u'NA',
  'country_code': u'US',
  'country_code3': u'USA',
  'country_name': u'United States',
  'dma_code': 807,
  'latitude': 37.4192008972168,
  'longitude': -122.05740356445312,
  'postal_code': u'94043',
  'region': u'CA'}

 This happens under ox X mountain lion and with kyngchaos gis/gdal binary
 packages as well as self compile brews.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.