Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

caching for production use

Replace CACHES config in settings.py file with this code part

CACHES = {
    'default': {
        'BACKEND': 'djpymemcache.backend.PyMemcacheCache',
        'LOCATION': '127.0.0.1:11211',
    }
}

Install memcached on linux env

sudo apt-get install memcached or yum install memcached

and install python library to work with memcache

pip install django-pymemcache

run the memcached service in daemon mode using this command

memcached -d

Now run the Django application, It'll use the memcached service to cache the results.

caching for production use

Replace CACHES config in settings.py file with this code part

CACHES = {
    'default': {
        'BACKEND': 'djpymemcache.backend.PyMemcacheCache',
        'LOCATION': '127.0.0.1:11211',
    }
}

Install memcached on linux env

sudo apt-get install memcached memcached

or

yum install memcached

memcached

and install python library to work with memcache

pip install django-pymemcache

run the memcached service in daemon mode using this command

memcached -d

Now run the Django application, It'll use the memcached service to cache the results.

caching for production use

Replace CACHES config in settings.py file with this code part

CACHES = {
    'default': {
        'BACKEND': 'djpymemcache.backend.PyMemcacheCache',
        'LOCATION': '127.0.0.1:11211',
    }
}

Install memcached on linux env

sudo apt-get install memcached

or

yum install memcached

and install python library to work with memcache

pip install django-pymemcache

run the memcached service in daemon mode using this command

memcached -d

To activate memcached permanently do:

systemctl  start memcached
systemctl  enable memcached

Now run the Django application, It'll use the memcached service to cache the results.