为django项目安装memcached [英] Installing memcached for a django project
问题描述
从django文档:
安装Memcached本身后,您需要安装一个memcached绑定。有几个python memcached绑定可用;两个最常见的是python-memcached和pylibmc。
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.
pylibmc文档有自己的要求:
The pylibmc docs have their own requirements:
-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
如何/我可以在哪里做?我一直习惯于安装任何我需要的,但我甚至不能告诉其中哪些是python包。这些捆绑在一起吗?
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 install python-memcached
你应该是好的。
Just do pip install python-memcached
and you should be good.
至于安装memcached本身,这取决于你所在的平台。
As for installing memcached itself, it depends on the platform you are on.
- Windows - http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/
- 操作系统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
在OS X / Linux上,只需在命令行中运行 memcached
。
On OS X/Linux, just run memcached
in the command line.
这篇关于为django项目安装memcached的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!