Django Muckraking
=================
A collection of various Django utilities. It includes:
Middleware
----------
:code:`muckraking.middleware.SpacelessMiddleware`
Removes spaces and line breaks between html tags. Leaves <script> blocks intact
:code:`muckraking.middleware.LegacyURLRedirectMiddleware`
An apache-like approach to redirects.
Specify your redirects in settings.py like this::
LEGACY_URL_REDIRECTS = (
(r'^/about/news-events\.php(.+)?', '/news-events/$1',),
(r'^/about/(?!index\.php)', '/about/',),
)
Template Context Processors
---------------------------
:code:`muckraking.template.context_processors.debug_context`
Add a :code:`{{ DEBUG }}` variable Django templates. The value is a boolean
Standard Template Tags
----------------------
To use the following tags, add :code:`{% load muckraking_tags %}` to your template.
:code:`{% version_hash %}`
Outputs either the Git HEAD commit hash, or a hash of the atime value of the Django settings module. It first tries to output the Git commit hash. If unsuccessful, it falls back to the settings module file time hash.
:code:`{% git_commit_hash %}`
Outputs the commit hash of the HEAD commit in a git repo. Useful for cache-busting strings.
:code:`{% settings_file_time_hash %}`
Outputs a hash of the atime meta value of the Django settings module file. Useful for cache-busting strings.
Django CMS Template Tags
------------------------
To use the following tags, add :code:`{% load muckraking_cms_tags %}` to your template.
:code:`{% page_url_by_slug "foobar-page" %}`
Allows you to perform reverse lookups on pages by slug::
Management Commands
-------------------
import_redirects
Allows you to import a csv file of redirect urls into the redicet app::
./manage.py import_redirects ~/path/to/redirects.csv
=================
A collection of various Django utilities. It includes:
Middleware
----------
:code:`muckraking.middleware.SpacelessMiddleware`
Removes spaces and line breaks between html tags. Leaves <script> blocks intact
:code:`muckraking.middleware.LegacyURLRedirectMiddleware`
An apache-like approach to redirects.
Specify your redirects in settings.py like this::
LEGACY_URL_REDIRECTS = (
(r'^/about/news-events\.php(.+)?', '/news-events/$1',),
(r'^/about/(?!index\.php)', '/about/',),
)
Template Context Processors
---------------------------
:code:`muckraking.template.context_processors.debug_context`
Add a :code:`{{ DEBUG }}` variable Django templates. The value is a boolean
Standard Template Tags
----------------------
To use the following tags, add :code:`{% load muckraking_tags %}` to your template.
:code:`{% version_hash %}`
Outputs either the Git HEAD commit hash, or a hash of the atime value of the Django settings module. It first tries to output the Git commit hash. If unsuccessful, it falls back to the settings module file time hash.
:code:`{% git_commit_hash %}`
Outputs the commit hash of the HEAD commit in a git repo. Useful for cache-busting strings.
:code:`{% settings_file_time_hash %}`
Outputs a hash of the atime meta value of the Django settings module file. Useful for cache-busting strings.
Django CMS Template Tags
------------------------
To use the following tags, add :code:`{% load muckraking_cms_tags %}` to your template.
:code:`{% page_url_by_slug "foobar-page" %}`
Allows you to perform reverse lookups on pages by slug::
Management Commands
-------------------
import_redirects
Allows you to import a csv file of redirect urls into the redicet app::
./manage.py import_redirects ~/path/to/redirects.csv
Metadata
Release files for django-muckraking 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-muckraking-0.3.2.tar.gz | 5.2 kB | Details |
Release files / django-muckraking-0.3.2.tar.gz
| Download URL | django-muckraking-0.3.2.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1940aa60ec4ef8e847f167da9582300cd08a13201de38d3e8685e1f1377bea2
|
|
BLAKE2b-256 checksum How to use checksums |
f97dc91c9e5a58e9d8b0391b64a305808fcf28bd8912664604db09005e4e7192
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |