Absolute URLs tools for django
Project description
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.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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-absolute-0.2.1.tar.gz
.
File metadata
- Download URL: django-absolute-0.2.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1fd8eddedba9598fd1bbfe64f68a6cab99af9bd6794a9b01f2e37a4b29a2071 |
|
MD5 | 72b3d9cc6e5fbbd41e32ae6d4303451e |
|
BLAKE2b-256 | 3b3ceb321dc1342a521f9dc6134b7ee9335dfc07824ea4d9fd3527c87de39bf5 |