django-easy-timezones icon indicating copy to clipboard operation
django-easy-timezones copied to clipboard

ImproperlyConfigured: GEOIP_DATABASE setting is defined, but file does not exist.

Open lucas03 opened this issue 9 years ago • 12 comments

I am having problem when pushing new app with django-easy-timezones. Basicly, I need to call manage.py collectstatic to put files GeoLiteCityv6.dat and GeoLiteCity.dat to static directory. But when I run manage.py collectstatic, following error is raised.

remote: django.core.exceptions.ImproperlyConfigured: GEOIP_DATABASE setting is defined, but file does not exist.
remote: ln: creating symbolic link `/var/lib/openshift/user/app-root/runtime/repo//wsgi/static/media': No such file or directory

Neverending cycle.

I also have a suggestion. Instead of a need to update geoip database manually, how about using https://github.com/futurecolors/django-geoip ?

lucas03 avatar Jan 20 '16 01:01 lucas03

I don't think you want the dat file in static, then it'll be publicly available..

On Wed, Jan 20, 2016 at 2:27 AM, Lukas Vojt [email protected] wrote:

I am having problem when pushing new app with django-easy-timezones Basicly, I need to call managepy collectstatic to put files GeoLiteCityv6dat and GeoLiteCitydat to static directory But when I run managepy collectstatic, following error is raised

remote: djangocoreexceptionsImproperlyConfigured: GEOIP_DATABASE setting is defined, but file does not exist remote: ln: creating symbolic link `/var/lib/openshift/user/app-root/runtime/repo//wsgi/static/media': No such file or directory

Neverending cycle

I also have a suggestion Instead of a need to update geoip database manually, how about using https://githubcom/futurecolors/django-geoip ?

— Reply to this email directly or view it on GitHub https://github.com/Miserlou/django-easy-timezones/issues/18.

Miserlou avatar Jan 20 '16 01:01 Miserlou

Why not? That file is publicly available anyway.

lucas03 avatar Jan 20 '16 02:01 lucas03

..okay..

So, what is the problem?

d-e-t comes with the dat files included now, you shouldn't even need to have them in your project.

On Wed, Jan 20, 2016 at 3:06 AM, Lukas Vojt [email protected] wrote:

Why not? That file is publicly available anyway.

— Reply to this email directly or view it on GitHub https://github.com/Miserlou/django-easy-timezones/issues/18#issuecomment-173060687 .

Miserlou avatar Jan 20 '16 02:01 Miserlou

oh, I did not know that. Ok, thanks. Probably I wrote this issue to early before thinking about it enough.

lucas03 avatar Jan 20 '16 02:01 lucas03

I am still missing those files:

django.core.exceptions.ImproperlyConfigured: GEOIP_DATABASE setting is defined, but file does not exist.

I installed this app like this: pip install django-easy-timezones==0.6.2. Then I deleted GEOIP_DATABASE and GEOIPV6_DATABASE variables, because you said they are optional. But I am still getting ImproperlyConfigured error. I can see that GEOIP files are in your pip package - https://pypi.python.org/pypi/django-easy-timezones but pip somehow does not use them? This is in my dist-packages(/usr/local/lib/python2.7/dist-packages) folder:

$ ls | grep easy_time
django_easy_timezones-0.6.2.dist-info
easy_timezones

$ ls easy_timezones/
__init__.py  __init__.pyc  middleware.py  middleware.pyc  signals.py  signals.pyc  tests.py  tests.pyc  urls.py  urls.pyc  utils.py  utils.pyc  views.py  views.pyc

Should those GEOIP files be in easy_timezones folder?

lucas03 avatar Jan 20 '16 02:01 lucas03

You're right, they are supposed to be. This seems to be a packaging problem, but I'm not sure why that's happening. For now, just set the paths explicitly and I'll fix this in a few h.

Miserlou avatar Jan 20 '16 03:01 Miserlou

Even I am getting same error. Also I downloaded them from repo and added explicitly. Now I am getting Invalid database type, expected City error

Did u fix this ?

a1Gupta avatar Jan 27 '16 15:01 a1Gupta

Is this issue fixed?

coler-j avatar Nov 08 '16 02:11 coler-j

why don't you make it possible to disable this GeoLiteCity check in the settings.py file?

thesunlover avatar Oct 27 '17 15:10 thesunlover

I am also getting this error: GEOIP_DATABASE setting is defined, but file does not exist.

NightHawk451 avatar Jul 11 '18 00:07 NightHawk451

This error is still present

pydevink avatar Apr 15 '20 18:04 pydevink

I am also getting this error caused by line 24 of middleware.py:

    raise ImproperlyConfigured("GEOIP_DATABASE setting is defined, but file does not exist.")
django.core.exceptions.ImproperlyConfigured: GEOIP_DATABASE setting is defined, but file does not exist.

jjhelfman avatar May 24 '20 22:05 jjhelfman