Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Jmbo banner app.

Project description

Jmbo Banner

Jmbo banner application. Banners are typically used to serve ads.



  1. Install or add jmbo-banner to your Python path.
  2. Add banner to your INSTALLED_APPS setting.
  3. Run migrate banner.


jmbo-banner allows users to create and edit banners in the admin. Each banner can optionally have a byline, a description block, images and CTA buttons. The way in which these components are laid out in each banner is defined in a banner style.

Content types

jmbo-banner defines the following content types:


  • A banner can consist of several buttons, although usually only two are used.
  • A button has a text field which can be used to specify its label, and a link object which can be used to specify its click-through.


  • A banner can be thought of as a container for promotional content. It can consist of buttons, images and promotional text. Each banner also has a style which controls how its contents are rendered.

Adding your own banner styles

It is sometimes necessary to have more styles in which banners can be rendered. This can easily be achieved by adding a package, banner_config to one of your own apps and ensuring that you create your custom style in a file. An example structure would be as follows:

<your app>/

All custom styles should inherit from BaseStyle. For most situations, overriding the template_name should suffice. It is important to bear in mind a style’s template is meant to be used as a partial containing only the banner content.

from banner.styles import BaseStyle

class CustomStyle(BaseStyle):
    Custom banner style
    template_name = "banner/custom_banner.html"

The CustomStyle should then be available for selection in the list of styles.

Getting banners to render on a page

Banners are typically rendered as part of a page. This can be achieved by using the render_banner template tag as shown below. The template tag accepts either a banner object or it’s slug.

{% extends "base.html" %}
{% load banner_tags %}

{% block content %}
    {% render_banner <object_or_slug> %}
{% endblock %}


Praekelt Consulting

  • Shaun Sephton
  • Jonathan Bydendyk
  • Hedley Roos
  • Phala Ramonyai



  1. Django 1.11 compatibility.
  2. Recreated Banner model with headline, body, and button components.
  3. Removed django-dfp dependency.


  1. Django 1.6 compatibility.


  1. Remove dependency on jmbo-foundry.
  2. Add tests.


  1. Rename get_absolute_url method to get_target_url since it was breaking Jmbo convention. If you have customized imagebanner_*.html then you need to update them.


  1. Remove redundant tests.
  2. Use newer version of django-dfp. If you have customized dfpbanner_detail.html or dfpbanner_list_item.html then you need to update them.


  1. If there is no actual banner and the banner proxy has no image set then don’t render anything.
  2. Cache templates.


  1. Multiple banners that match a regex are now randomized to effect banner rotation.

# Hotfix. Split paths on any whitespace.

  1. Hotfix. Skip over empty paths to avoid an exception.

  1. Hotfix. Properly fall back to default banner if it is set.

  1. Hotfix. Add missing migration.


  1. Use search instead of match for regular expressions.
  2. A Banner Proxy now has an optional default banner.
  3. Consider query string when doing regex matching for Banner Proxies.


  1. Add a BannerProxy model that inspects the URL and renders a banner designated to render for that URL.


  1. DFP banners draw themselves when loaded via ajax. The code is in the new banner.js.


  1. Hotfix release. Add missing files.
  2. Display error message in admin interface to notify of missing banner urls.


  1. Google DFP banner functionality for web and mobi. This facilitates advertising and tracking using Google’s DFP service.
  2. created. Be sure to add it to your project urls.
  3. Dependency on django-dfp>=0.1.2.
  4. We now have South migrations.


  1. Create list item templates for code banners.


  1. Use correct photosize name.


  1. Use older jmbo-foundry API for image URLs.


  1. Add dependency on jmbo-foundry>=0.7.


  1. Fix incorrect photosizes.json

Project details

Download files

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

Files for jmbo-banner, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size jmbo_banner-1.0-py2.7.egg (27.3 kB) File type Egg Python version 2.7 Upload date Hashes View hashes
Filename, size jmbo-banner-1.0.tar.gz (15.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page