Skip to main content

django-pygmy is a little app that colorizes source codez in your Django templates.

It uses pygments for prettify the codez.

https://travis-ci.org/mattack108/django-pygmy.png

Installation

To install django-pygmy, simply run:

pip install django-pygmy

Then add the app to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...,
    'django_pygmy',
)

Usage

Render the awesomeness in your template:

{% load pygmy %}

{% pygmy object.code %}

It also takes the same options as HtmlFormatter class:

{% pygmy object.code nowrap='True' linenos='table' %}

Lexers

By default django-pygmy tries to guess which lexer to use based on the provided code.

If you wish you can define any lexer of Pygments lexers like so:

{% pygmy object.code lexer='python' %}

Dependencies

  • Python 2.6 - 3.3

  • Django 1.3 - 1.5

  • pygments >= 1.6

Metadata

Release files for django-pygmy 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-pygmy 0.1.5
File Size Uploaded
django-pygmy-0.1.5.tar.gz 3.6 kB Details

Release files / django-pygmy-0.1.5.tar.gz

Download URL django-pygmy-0.1.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d32a39cb80cf377d89e7a17e49b98f3daa3b8d443ccfa06946bb6bf333841ad1
BLAKE2b-256 checksum
How to use checksums
b880efcf3a44c55d3afe3df6af9bc77050a7327ded21546f41517c77213b6f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page