Skip to content
Snippets Groups Projects
Commit c665dc7e authored by ale's avatar ale
Browse files

try to use pylibmc if present, before memcache

parent db442f67
No related branches found
No related tags found
No related merge requests found
......@@ -64,9 +64,14 @@ def create_app(userdb=None, mc=None):
app.userdb = userdb
if not mc:
import memcache
mc = memcache.Client(
app.config['MEMCACHE_ADDR'], debug=0)
try:
import pylibmc
mc = pylibmc.Client(
app.config['MEMCACHE_ADDR'], binary=True)
except ImportError:
import memcache
mc = memcache.Client(
app.config['MEMCACHE_ADDR'], debug=0)
app.memcache = mc
return app
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment