Django Absolute
Django Absolute provides context processors and template tags to use full absolute URLs in templates.
Installation
You can install Django Absolute with pip:
pip install django-absolute
or with easy_install:
easy_install django-absolute
Add absolute to your settings.INSTALLED_APPS.
Context processor
Add absolute.context_processors.absolute to your settings.TEMPLATE_CONTEXT_PROCESSORS. Django Absolute context processor depends on request context processor:
from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
'django.core.context_processors.request',
'absolute.context_processors.absolute',
)
Then you can access the following variables in your templates:
ABSOLUTE_ROOT: full absolute root URL (without trailing slash) based on incoming request
ABSOLUTE_ROOT_URL: full absolute root URL (with trailing slash) based on incoming request
SITE_ROOT: full absolute root URL (without trailing slash) based on current Django Site
SITE_ROOT_URL: full absolute root URL (with trailing slash) based on current Django site
Changelog
0.3 (2013-03-03)
Check if django.contrib.sites is enabled (thanks to Rodrigo Primo)
Django 1.5 compatibility (Documentation and tests)
Added absolute_future template tag library (match {% load url from future %} syntax).
drop support for Python 2.6 (test only)
0.2.2 (2012-11-18)
Handle template tag as syntax
0.2.1 (2012-11-10)
Fix packaging
0.2 (2012-11-10)
{% site %} fallback on http protocol if request is missing.
0.1 (2012-06-10)
Initial release
Metadata
Release files for django-absolute 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-absolute-0.3.tar.gz | 10.0 kB | Without provenance | Details |
Release files / django-absolute-0.3.tar.gz
| Download URL | django-absolute-0.3.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41ad9c819c80539cd604b9dea5c735252476616f071d739a8638aa9307df5857
|
|
BLAKE2b-256 checksum How to use checksums |
180277ed5333f547ac95243bd0598372a338340536dfa5bfee3ed5753fa01b75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-absolute 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.