Skip to main content

No project description provided

Project description

A fork of “django-app-plugins” which caches the results of the lookups, saving several db queries per page.

Requirements:

Django 1.2 or higher, tested up to Django 1.3.1

An exaple of usage is in the blog post http://coderseye.com/2008/app-plugins-example.html A shortened part of this is copied here:

In our base template, we just have to put this tag:

{% plugin_point "shop_sidebar" %}

And in our shop/__init__.py file, we set up the plugin point like so:

def shop_sidebar(point, context, user, *args, **kwargs):
    '''A section on the sidebar of the base screen'''
    return { }

register.plugin_point(takes_context=True, takes_user=True)(shop_sidebar)

Lastly, we add a new template at templates/wishlist/plugins/shop_sidebar.html

{% load i18n %}
{% if user.is_authenticated %}
<p class="wishlist">
<a href="{% url satchmo_wishlist_view %}">
{% trans 'Wishlist' %}
</a></p>
{% endif %}

A complete functional example and test app from http://coderseye.com/files/app-plugin-test.zip is unzipped to the directory app_plugins/test_app and little upgraded for compatibility with Django 1.3.

One application, which registeres a plugin point by app_plugins. (app “site”) One (or more) application which provide output to this plugin point without knowledge about app_plugins. (app “someapp”)

cd app_plugins/test_app
python manage.py syncdb
python manage.py runserver

Browse to http://localhost:8000/ All templates with names name_of_app/plugins/name_of_pluginpoint.html are combined together to the same plugin point . Applications can be added or removed without changing anything except INSTALLED_APPS.

History

The original project http://code.google.com/p/django-app-plugins/ have been forked at changeset r19 on Jan 25, 2009 (http://code.google.com/p/django-app-plugins/source/detail?r=19 ) Changes of the original project made after this date are mostly not reflected yet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangoplicity-caching-app-plugins-0.1.6.tar.gz (16.1 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page