Skip to content

[BUG] memcached support with django 4.1 and above #2877

@lrrb

Description

@lrrb

Describe the bug

I can't use memcached with Graphite and Django 4.2
Django 4.x+ has removed python-memcached
https://docs.djangoproject.com/en/5.1/releases/4.1/

/opt/graphite# export PYTHONPATH=/opt/graphite/webapp
 (graphite) root@my-server:/opt/graphite# export DJANGO_SETTINGS_MODULE=graphite.settings
 (graphite) root@my-server:/opt/graphite# django-admin migrate
 Traceback (most recent call last):
   File "/opt/graphite/lib/python3.11/site-packages/django/utils/module_loading.py", line 30, in import_string
     return cached_import(module_path, class_name)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/opt/graphite/lib/python3.11/site-packages/django/utils/module_loading.py", line 16, in cached_import
     return getattr(module, class_name)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 AttributeError: module 'django.core.cache.backends.memcached' has no attribute 'MemcachedCache'. Did you mean: 'PyMemcacheCache'?

To Reproduce

Enable memcached in local_settings.py

MEMCACHE_HOSTS = ['127.0.0.1:11211']

Expected behavior

I would like to install pymecached and be able to use Graphite with memcached.

Environment (please complete the following information):

  • OS flavor: Ubuntu 22
  • Graphite-web version: current master
  • Django/Python version Django 4.2 python 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions