Linux 为 django 项目安装 memcached
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7636108/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing memcached for a django project
提问by Matt Parrilla
From the django docs:
来自 Django 文档:
After installing Memcached itself, you'll need to install a memcached binding. There are several python memcached bindings available; the two most common are python-memcached and pylibmc.
安装 Memcached 本身后,您需要安装 memcached 绑定。有几个可用的 python memcached 绑定;最常见的两个是 python-memcached 和 pylibmc。
The pylibmc docs have their own requirements:
pylibmc 文档有自己的要求:
-libmemcached 0.32 or later (last test with 0.51)
-zlib (required for compression support)
-libsasl2 (required for authentication support)
So it seems to me that I need to do the following:
所以在我看来,我需要做以下事情:
-install memcached
-install libmemcached
-install zlib
-install libsas12
-install pylibmc
How/where can I do this? I've been used to just pip installing whatever I need but I can't even tell which of these are python packages. Are these bundled together anywhere?
我如何/在哪里可以做到这一点?我已经习惯于 pip 安装我需要的任何东西,但我什至不知道其中哪些是 python 包。这些在任何地方捆绑在一起吗?
采纳答案by Matt Williamson
Just do pip install python-memcached
and you should be good.
就去做pip install python-memcached
,你应该会很好。
As for installing memcached itself, it depends on the platform you are on.
至于安装 memcached 本身,这取决于您所在的平台。
- Windows - http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/
- OS X -
brew install memcached
- Debian/Ubuntu -
sudo apt-get install memcached
- Windows - http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/
- OS X -
brew install memcached
- Debian/Ubuntu -
sudo apt-get install memcached
On OS X/Linux, just run memcached
in the command line.
在 OS X/Linux 上,只需memcached
在命令行中运行。
回答by Ilian Iliev
Detailed explanation here http://ilian.i-n-i.org/caching-websites-with-django-and-memcached/
这里详细解释http://ilian.ini.org/caching-websites-with-django-and-memcached/
The link above includes explanations for how to install Memcached on Ubuntu, how to configure it as cache engine in your Django project and how to use it.
上面的链接包括如何在 Ubuntu 上安装 Memcached、如何在 Django 项目中将其配置为缓存引擎以及如何使用它的说明。