Miserlou / django-easy-timezones

Easy timezones for Django based on GeoIP
http://gun.io/blog/django-easy-timezones/
Apache License 2.0
203 stars 44 forks source link

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

Open lucas03 opened 8 years ago

lucas03 commented 8 years ago

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 ?

Miserlou commented 8 years ago

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 notifications@github.com 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.

lucas03 commented 8 years ago

Why not? That file is publicly available anyway.

Miserlou commented 8 years ago

..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 notifications@github.com 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 .

lucas03 commented 8 years ago

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

lucas03 commented 8 years ago

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?

Miserlou commented 8 years ago

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.

a1Gupta commented 8 years ago

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 ?

coler-j commented 8 years ago

Is this issue fixed?

thesunlover commented 7 years ago

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

NightHawk451 commented 6 years ago

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

pydevink commented 4 years ago

This error is still present

jjhelfman commented 4 years ago

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.