Skip to main content

Django helpers for working with the web.

Project description

Django Web Utils

Some helpers for working with the web.

Provided are:


formats currency (USD) to a string.

>>> cash = 1250
>>> formatted = format_currency(cash)
>>> formatted = format_currency(cash, places=0)
>>> cash = 0
>>> formatted = format_currency(cash, show_zero=False)

format_currency template tag

For django to be able to find the templatetags, you’ll need to register web_utils in your INSTALLED_APPS settings

{% load formatting_tags %}

# value, places, show_zero flag. {% format_currency cash_amount 0 “False” %}


A signal receiver to ping Google Sitemap to let them know your content changed

  1. Add the following to PING_GOOGLE_SITEMAP = True SITE_DOMAIN = ‘

  2. Add a named url: ‘sitemap’ so the method can resolve your sitemap url

  3. Register the receiver on whatever signal you’d like to trigger the ping.

    receiver(models.signals.post_save, sender=BlogEntry, dispatch_uid=”BlogEntry”)(ping_google_sitemap)


Allows you to force various urls through https or http

  1. Add SSL_ENABLED = True to your

  2. Add web_utils.middleware.SSLMiddleware to your middleware settings

  3. Add a USE_SSL = True/False to a route’s view_kwargs

    url(r’^admin/’, include(, kwargs={‘USE_SSL’: True}),

By default, all routes will be forced to http unless they have USE_SSL=True If you would like to flip this and secure everything except only specific routes add USE_SSL_DEFAULT=True to your settings.

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 django-web-utils, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size django-web-utils-0.1.1.tar.gz (7.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page