This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# django-json-messages
Add json encoded messages (from Django messages framework) to templates

# Install

pip install django-json-messages

# Usage

## Django messages

Make sure the [Django messages framework]( is installed and working.

## App

Add `json_messages` to your list of `INSTALLED_APPS`

## Context processor

Add `json_messages.context_processors.json_messages` in your `CONTEXT_PROCESSORS` settings.

A `json_messages` property is now available on the context.

It is a dict version of the messages with `msg` and `type` keys

## Template tags

### Loading

Use `{% load json_messages %}` at the top of your template

### Json dump

Use `{% json_messages_dump %}` to simply dump the json encoded messages into your template

**Note** that all messages' `msg` properties are passed through Django's [escapejs]( for security reasons.

### Script

Use `{% json_messages_script %}` to dump the messages array into a Javascript window variable called ` messages `

This is equivalent to writing

<script type="text/javascript">
window.messages = {% json_messages_dump %};

#### Configuration

- Set a context variable `js_variable` to override the name of the window variable use by `{% json_messages_script %}`
{% json_messages_script js_variable="blop" %}
results in
<script type="text/javascript">
window.blop = [{"type":"danger", "msg":"Something"}];
Defaults to *"messages"*

## Package dependencies

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_json_messages-0.1.2-py2.py3-none-any.whl (5.4 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Feb 25, 2015
django-json-messages-0.1.2.tar.gz (3.6 kB) Copy SHA256 Checksum SHA256 Source Feb 25, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting