Thanks for the help. That was the problem, I had django 3.0. I just 
upgraded it.

On Saturday, June 12, 2021 at 3:09:45 AM UTC+5:30 jacobgr...@gmail.com 
wrote:

> Looks like only django 3.2 uses PyMemcacheCache.
> Try:
> "django.core.cache.backends.memcached.MemcachedCache"
>
> Also, make sure you are using the docs for the correct version of django:
> For example: 
> https://docs.djangoproject.com/en/3.0/topics/cache/
>
> instead of: 
>
> https://docs.djangoproject.com/en/3.2/topics/cache/
>
> On Fri, Jun 11, 2021 at 4:20 PM VISHESH MANGLA <
> f201...@pilani.bits-pilani.ac.in> wrote:
>
>> Hello, 
>> Please help with the following error
>>
>> settings.py 
>>
>> CACHES = {
>>     "default": {
>>          'BACKEND': 
>> 'django.core.cache.backends.memcached.PyMemcacheCache',
>>         'LOCATION': '127.0.0.1:11211'
>>     }
>> }
>>
>>
>> #CACHE_MIDDLEWARE_ALIAS = "teut_cache"
>> #CACHE_MIDDLEWARE_SECONDS = 500
>> #CACHE_MIDDLEWARE_KEY_PREFIX  = ...
>>
>>
>> # Set the cache backend to select2
>> SELECT2_CACHE_BACKEND = "default"
>>
>>
>>
>> Error logs:
>>
>> (venv) PS C:\Users\Dell\OneDrive\Desktop\office\djangodev\massservices> 
>> python manage.py runserver
>> Watching for file changes with StatReloader
>> Performing system checks...
>>
>> Exception in thread django-main-thread:
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\module_loading.py",
>>  
>> line 20, in import_string
>>     return getattr(module, class_name)
>> AttributeError: module 'django.core.cache.backends.memcached' has no 
>> attribute 'PyMemcacheCache'
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\cache\__init__.py",
>>  
>> line 50, in _create_cache
>>     backend_cls = import_string(backend)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\module_loading.py",
>>  
>> line 22, in import_string
>>     raise ImportError('Module "%s" does not define a "%s" 
>> attribute/class' % (
>> ImportError: Module "django.core.cache.backends.memcached" does not 
>> define a "PyMemcacheCache" attribute/class
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "c:\python38\lib\threading.py", line 932, in _bootstrap_inner
>>     self.run()
>>   File "c:\python38\lib\threading.py", line 870, in run
>>     self._target(*self._args, **self._kwargs)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\autoreload.py",
>>  
>> line 53, in wrapper      
>>     fn(*args, **kwargs)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\management\commands\runserver.py",
>>  
>> line 118, in inner_run
>>     self.check(display_num_errors=True)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\management\base.py",
>>  
>> line 392, in check   
>>     all_issues = checks.run_checks(
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\registry.py",
>>  
>> line 70, in run_checks
>>     new_errors = check(app_configs=app_configs, databases=databases)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\urls.py",
>>  
>> line 13, in check_url_config
>>     return check_resolver(resolver)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\checks\urls.py",
>>  
>> line 23, in check_resolver
>>     return check_method()
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 408, in check
>>     for pattern in self.url_patterns:
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\functional.py",
>>  
>> line 48, in __get__      
>>     res = instance.__dict__[self.name] = self.func(instance)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 589, in url_patterns  
>>     patterns = getattr(self.urlconf_module, "urlpatterns", 
>> self.urlconf_module)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\utils\functional.py",
>>  
>> line 48, in __get__      
>>     res = instance.__dict__[self.name] = self.func(instance)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 582, in urlconf_module    return import_module(self.urlconf_name)
>>   File "c:\python38\lib\importlib\__init__.py", line 127, in import_module
>>     return _bootstrap._gcd_import(name[level:], package, level)
>>   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
>>   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
>>   File "<frozen importlib._bootstrap>", line 975, in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
>>   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
>>   File "<frozen importlib._bootstrap>", line 219, in 
>> _call_with_frames_removed
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\massservices\massservices\urls.py",
>>  
>> line 7, in <module>
>>     path("select2/", include("django_select2.urls")),
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\urls\conf.py",
>>  
>> line 34, in include
>>     urlconf_module = import_module(urlconf_module)
>>   File "c:\python38\lib\importlib\__init__.py", line 127, in import_module
>>     return _bootstrap._gcd_import(name[level:], package, level)
>>   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
>>   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
>>   File "<frozen importlib._bootstrap>", line 975, in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
>>   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
>>   File "<frozen importlib._bootstrap>", line 219, in 
>> _call_with_frames_removed
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django_select2\urls.py",
>>  
>> line 14, in <module>
>>     from .views import AutoResponseView
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django_select2\views.py",
>>  
>> line 7, in <module>
>>     from .cache import cache
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django_select2\cache.py",
>>  
>> line 20, in <module>
>>     cache = caches[settings.SELECT2_CACHE_BACKEND]
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\cache\__init__.py",
>>  
>> line 79, in __getitem__
>>     cache = _create_cache(alias)
>>   File 
>> "C:\Users\Dell\OneDrive\Desktop\office\djangodev\venv\lib\site-packages\django\core\cache\__init__.py",
>>  
>> line 52, in _create_cache
>>     raise InvalidCacheBackendError(
>> django.core.cache.backends.base.InvalidCacheBackendError: Could not find 
>> backend 'django.core.cache.backends.memcached.PyMemcacheCache': Module 
>> "django.core.cache.backends.memcached" does not define a "PyMemcacheCache" 
>> attribute/class
>>
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/7195a5f1-6c34-41a2-9f6c-1ef105954598n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/7195a5f1-6c34-41a2-9f6c-1ef105954598n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1f5e60a8-495e-4632-b0e7-e9ed4305ee77n%40googlegroups.com.

Reply via email to