Skip to main content

{{ BASE_URL }} django template variable

Project description

Installation

$ [sudo] pip install django-base-url

How it works

settings BASE_URL if defined, else scheme+request.get_host()

settings.py
TEMPLATE_CONTEXT_PROCESSORS = (
    "django_base_url.context_processors.base_url",
)

Examples

settings.py:

BASE_URL="http://host/"
<base href="{{ BASE_URL }}">

readme42.com

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

django-base-url-2020.12.3.tar.gz (1.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page