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

KeyError: 'BACKEND' #202

Open
pyprism opened this issue Jul 13, 2021 · 0 comments
Open

KeyError: 'BACKEND' #202

pyprism opened this issue Jul 13, 2021 · 0 comments

Comments

@pyprism
Copy link

pyprism commented Jul 13, 2021

When I enabled django-redis-cache I got this error:

 ./manage.py check                            

Traceback (most recent call last):
  File "./manage.py", line 21, in <module>
    main()
  File "./manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "---.venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "---/.venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "---/.venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "----/.venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "--/.venv/lib/python3.8/site-packages/django/core/management/commands/check.py", line 63, in handle
    self.check(
  File "---/.venv/lib/python3.8/site-packages/django/core/management/base.py", line 419, in check
    all_issues = checks.run_checks(
  File "--/.venv/lib/python3.8/site-packages/django/core/checks/registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "---/.venv/lib/python3.8/site-packages/django/core/checks/caches.py", line 63, in check_file_based_cache_is_absolute
    cache = caches[alias]
  File "---/.venv/lib/python3.8/site-packages/django/utils/connection.py", line 62, in __getitem__
    conn = self.create_connection(alias)
  File "---/.venv/lib/python3.8/site-packages/django/core/cache/__init__.py", line 36, in create_connection
    backend = params.pop('BACKEND')
KeyError: 'BACKEND'


settings.py:

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': 'localhost:6379',
    },
    'OPTIONS': {
        'DB': 11,
    }
}

I am using 0.6.2

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

1 participant