Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django.core.exceptions.ImproperlyConfigured: "server" must be an iterable or string #80

Closed
mikeedwards opened this issue Jul 4, 2015 · 6 comments

Comments

@mikeedwards
Copy link

When I pass a value of "server" that is type unicode instead of str I get:

  File "/Users/Mike_Edwards/.virtualenvs/emojicatch/lib/python2.7/site-packages/redis_cache/backends/base.py", line 84, in get_servers
    '"server" must be an iterable or string'
django.core.exceptions.ImproperlyConfigured: "server" must be an iterable or string

More specifically, the django-environ app is what's passing the value in as unicode but it seems like that should work either way.

It looks as though a recent change to get_servers uses isinstance narrowly and only allows values that are type str:
f88925a#diff-8fc3ae3ff1cb89b2f4ba473a41661d77R78

I'm using:
python 2.7.6
Django 1.8.2
django-environ 0.3.0

@sebleier
Copy link
Owner

@mikeedwards – The latest release should have fixed that issue, let me know if it works for you.

@emilioramirez
Copy link

@sebleier yes, I update to django-redis-cache==1.2.1 and works fine. Thanks.

@sebleier
Copy link
Owner

@emilioramirez – Great! Thanks for testing.

@monokrome
Copy link

Seems like this issue may be back in 2.1.0?

@wowkin2
Copy link

wowkin2 commented Jun 5, 2020

Same for me 2.1.1.

@wowkin2
Copy link

wowkin2 commented Jun 5, 2020

Found that in following configuration REDIS_URL is empty or not configured. So, works fine.

CACHES = {
    "default": {
         "BACKEND": "redis_cache.RedisCache",
         "LOCATION": os.environ.get('REDIS_URL'),
    }
}

FYI, @monokrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants