GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - KLab/Flask-PyMemcache: PyMemcache integration for Flask

BranchesTags
Open more actions menu

Latest commit

 

History

41 Commits
41 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.rst
README.rst
 
 
pyproject.toml
pyproject.toml
 
 
requirements-dev.lock
requirements-dev.lock
 
 

Repository files navigation

pymemcache integration for Flask

Install

Install from https://pypi.org/project/Flask-PyMemcache/

pip install Flask-PyMemcache

Initialize

memcache = FlaskPyMemcache(app)

or:

memcache = FlaskPyMemcache()
memcache.init_app(app)

Configuration

Put kwargs for pymemcache to PYMEMCACHE in your Flask configuration.

PYMEMCACHE = {
    'server': ('localhost', 11211),
    'connect_timeout': 1.0,
    'timeout': 0.5,
    'no_delay': True,
    'key_prefix': b'myapp-',
}

You can use different config key with conf_key keyword:

session = FlaskPyMemcache(conf_key='MEMCACHE_SESSION')
cache = FlaskPyMemcache(conf_key='MEMCACHE_CACHE')

session.init_app(app)
cache.init_app(app)

In addition to normal pymemcache kwargs, Flask-PyMemcache provides following configuration options.

  • close_on_teardown -- Close connection to memcached when app teardown.

Use

memcache.client.set('foo', 'bar')

About

PyMemcache integration for Flask

Topics

mit-licensepython

Resources

Readme
MIT license
Activity
Custom properties

Stars

6 stars

Watchers

10 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.