There are several things we need to do in order to prepare caching for our Django project:
- Let's install the memcached service. For example, the simplest way to do that on macOS is to use Homebrew:
$ brew install memcached
- Then, you can start, stop, or restart the Memcached service with these commands:
$ brew services start memcached$ brew services stop memcached$ brew services restart memcached
On other operating systems, you can install Memcached using apt-get, yum, or other default package management utilities. Another option is to compile it from the source, as mentioned at
https://memcached.org/downloads.
- Install Memcached Python bindings in your virtual environment, as follows:
(env)$ pip install python-memcached== ...