{"_id":"553d394e9660ba0d00569d0c","githubsync":"","user":"543466ea0e8e2b0e00341818","__v":0,"version":{"_id":"553d394d9660ba0d00569d07","project":"543467200ef9c00800164ecc","forked_from":"54bedb2fffb79c320030db1f","__v":1,"createdAt":"2015-04-26T19:15:25.245Z","releaseDate":"2015-04-26T19:15:25.245Z","categories":["553d394d9660ba0d00569d08","553d394d9660ba0d00569d09"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.11.2","version":"0.11.2"},"project":"543467200ef9c00800164ecc","category":{"_id":"553d394d9660ba0d00569d09","pages":["553d394e9660ba0d00569d0a","553d394e9660ba0d00569d0b","553d394e9660ba0d00569d0c","553d394e9660ba0d00569d0d","553d394e9660ba0d00569d0e","553d394e9660ba0d00569d0f","553d394e9660ba0d00569d10","553d394e9660ba0d00569d11","553d394e9660ba0d00569d12"],"project":"543467200ef9c00800164ecc","__v":1,"version":"553d394d9660ba0d00569d07","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-15T18:17:35.811Z","from_sync":false,"order":1,"slug":"extensions","title":"EXTENSIONS"},"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-15T18:23:20.454Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"never","params":[],"url":""},"isReference":false,"order":5,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"glim-memcached\"\n}\n[/block]\nglim-memcached is a glim framework extension for bringing up memcached features to glim. It uses [pinterest's memcache module](https://github.com/pinterest/pymemcache).\n\n# Installation\n- install [pymemcache](https://github.com/pinterest/pymemcache)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# install glim-extensions from pip\\npip install glim-extensions\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n# Configuration\nAppend the following config to the extensions config;\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# app/config/<env>.py\\nconfig = {\\n    'extensions' : {\\n        'memcached' : {\\n            'default' : {\\n                'host' : 'localhost',\\n                'port' : 11211,\\n            }\\n            # add a new dict for connecting multiple redis\\n            # servers\\n        }\\n    },\\n    # ...\\n}\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nHere default is used for connection aliasing. Memcached can handle multiple connections.\n\nStart your web server and that's it!\n\n# Usage\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"from glim_extensions.memcached import Cache\\n\\n# performs operations in default connection\\nCache.set('foo', 'bar')\\nCache.get('foo')\\n\\n# performs operations in aliased connection\\nCache.connection('connection-name').set('foo', 'bar')\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"memcached","type":"basic","title":"Memcached"}
[block:api-header] { "type": "basic", "title": "glim-memcached" } [/block] glim-memcached is a glim framework extension for bringing up memcached features to glim. It uses [pinterest's memcache module](https://github.com/pinterest/pymemcache). # Installation - install [pymemcache](https://github.com/pinterest/pymemcache) [block:code] { "codes": [ { "code": "# install glim-extensions from pip\npip install glim-extensions", "language": "shell" } ] } [/block] # Configuration Append the following config to the extensions config; [block:code] { "codes": [ { "code": "# app/config/<env>.py\nconfig = {\n 'extensions' : {\n 'memcached' : {\n 'default' : {\n 'host' : 'localhost',\n 'port' : 11211,\n }\n # add a new dict for connecting multiple redis\n # servers\n }\n },\n # ...\n}", "language": "python" } ] } [/block] Here default is used for connection aliasing. Memcached can handle multiple connections. Start your web server and that's it! # Usage [block:code] { "codes": [ { "code": "from glim_extensions.memcached import Cache\n\n# performs operations in default connection\nCache.set('foo', 'bar')\nCache.get('foo')\n\n# performs operations in aliased connection\nCache.connection('connection-name').set('foo', 'bar')", "language": "python" } ] } [/block]