• Stars
    star
    269
  • Rank 152,251 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 15 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Django admin extension that displays statistics about your memcached instances.

django-memcache-status

This app displays the current load and some statistics for your memcached instances in the index view of your Django admin section.

Currently these memcached bindings are tested:

Backend Support
django.core.cache.backends.memcached.PyLibMCCache βœ… Works fine
django.core.cache.backends.memcached.PyMemcacheCache ❎ Does not provide stats

Other bindings may provide statistics too.

Compatibility Matrix:

Py/Dj 3.8 3.9 3.10 3.11
3.2 (LTS) βœ“ βœ“ βœ“ βœ“
4.0 βœ“ βœ“ βœ“ βœ“
4.1 βœ“ βœ“ βœ“ βœ“
4.2 (LTS) βœ“ βœ“ βœ“ βœ“

Installation

First add memcache_status to your INSTALLED_APPS list.

INSTALLED_APPS = [
    # ...
    'memcache_status',
]

Then you have two options:

  1. The quickest way is to replace your Django Admin index page with the one provided by django-memcache-status. This will show the memcache stats in the top left column. This was the regular behavior of django-memcache-status prior to version 2.0.

    Place this in any admin.py file of your project:

    from django.contrib import admin
    admin.site.index_template = 'memcache_status/admin_index.html'
    
  2. If you need to manually place the stats, simply add the CSS file and include the memcache-status template anywhere you like:

    <link rel="stylesheet" href="{% static "memcache_status.css" %}"/>
    {% include "memcache_status/memcache_status.html" %}
    

Local Development

Install the package using Pipenv and run the tests:

$ pipenv install --dev
$ pipenv run test

You can test against a matrix of Python and Django versions using tox:

$ tox

Once run you will see a coverage report in /tmp/coverage_report/django-memcache-status.

You can run a local runserver with the test application to see the admin:

$ pipenv run django-admin.py migrate
$ pipenv run django-admin.py createsuperuser
$ pipenv run django-admin.py runserver

To test a specific cache backend define it in the env variable:

$ TEST_CACHE_BACKEND=django-pylibmc pipenv run django-admin.py runserver

Note

If you're testing pylibmc on OS X and you get an error like 'libmemcached/memcached.h' file not found, install pylibmc manually, then run the installation again:

$ brew install libmemcached
$ pipenv run pip install pylibmc --install-option="--with-libmemcached=/usr/local/Cellar/libmemcached/1.0.18_2/"
$ pipenv install --dev

Changelog

v2.3 (2023-04-30):

  • Compatibility and tests for Django 3.2 to 4.2, and Python 3.11.
  • Dropped support for Django 2.2.

v2.2 (2020-02-05):

  • Compatibility and tests for Django 2.2 and 3.0, and Python 3.8.
  • Use pytest for testing.

v2.1 (2019-03-21):

  • Removed some deprecated django-debug-toolbar and pre-Django 1.11 related workarounds.
  • More comprehensive unittests across all backends and it's relation with django-debug-toolbar.

v2.0 (2019-03-16):

  • Compatibility and tests for Django 1.11 β†’ 2.1 and Python 2.7 β†’ 3.7.
  • Full code cleanup and update to latest standards.
  • Tested against a variety of memcache bindings.
  • Pipenv support for local development and testing.
  • [Backwards Incompatible] memcache-status no longer automatically overwrites the admin index template to add the stats. Instead you have the option to either manually display the stats anywhere you like using a template include, or use the contributed memcache-status admin index page that overwrites the vanilla Django template and adds statistics to the top left admin index page. This was the regular behavior of django-memcache-status prior to version 2.0.

v1.3 (2016-10-13):

  • Django 1.10 compatibility and test integration. Python 3 compatibility.

v1.2 (2009-11-06):

  • Unittests, General code cleanup to support Django 1.8+ features such as
  • AppConfig, Django-Debugtoolbar support, Python3 Support, Compatibility tests
  • with latest supported Django versions (currently Django 1.8 and 1.9) but the
  • package is likely working with Django 1.4+.

v1.1 (2009-06-29):

  • Added support for Django's multiple cache backend setting. Kudos to Luke Granger-Brown for the implementation.
  • This version is compatible with Django v1.3 and up.

v1.0 (2009-04-30):

  • Initial Release.
  • This version is compatible up to Django v1.2.

Screenshots

https://user-images.githubusercontent.com/1896/54476030-f0dd3080-47f8-11e9-8399-b11f3bf15ebc.png https://user-images.githubusercontent.com/1896/54476031-f470b780-47f8-11e9-842f-95d880563a53.png

More Repositories

1

django-attachments

A generic Django application to attach Files (Attachments) to any model.
Python
288
star
2

django-frontendadmin

Not in active development; see README -- django-frontendadmin is a set of templatetags to allow an easy and unobstrusive way to edit model-data in the frontend of your page. See wiki for screencast!
Python
188
star
3

pip-check

pip-check gives you a quick overview of all installed packages and their update status.
Python
156
star
4

django-markup

Convert text markup to html. Markdown, rST, Textile etc.
Python
143
star
5

django-wakawaka

A simple wiki app written in Python using the Django framework.
Python
114
star
6

django-generic-flatblocks

A flatpages/flatblock application using generic relations to content models.
Python
67
star
7

django-templatesadmin

Not in active development. See readme. A Django app to make minor changes to your templates on the fly.
Python
54
star
8

django-eventlog

django-eventlog is a very simple event logger you can use to track certain actions in your code. Events are stored in a Django model and can be viewed in the Django Admin.
Python
29
star
9

django-comments-spamfighter

Not in active development; see README -- A Django app that contributes Akismet and Keyword blocking to your django comments.
Python
17
star
10

dpasteGUI

The OS X gui to quickly paste snippets to the dpaste.de pastebin.
Objective-C
10
star
11

django-staticinline

Django template tag to load static files inline with your template.
Python
9
star
12

SubDpaste

Paste code snippets on dpaste.de.
Python
8
star
13

tab

Opens a new OS X Terminal window with the current directory and runs an optional command in it.
Python
5
star
14

starcel

Starcel is a static page generator that helps you to transforms HTML/CSS/JS using ParcelJS.
HTML
3
star
15

fetch-sitemap

Python
1
star
16

go-like

It's like a Facebook Like button, but without Facebook.
Go
1
star