Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Provides the URL for an asset server, as a template context variable.

Project Description

Provides {{ ASSET_SERVER_URL }} (the URL for an asset server) as a template context variable. Can be set through settings.py or by passing an environment variable to the app.

Setup

# settings.py
TEMPLATE_CONTEXT_PROCESSORS += [
    "assets_template_context.asset_server_url"
]

Definition

Set it in settings, e.g.:

# settings.py
ASSET_SERVER_URL = '//assets.example.com/'

Or when starting the site, e.g.:

ASSET_SERVER_URL=//assets.example.com/ python manage.py runserver

Usage

Use in templates:

# templates/index.html

<img src="{{ ASSET_SERVER_URL }}a34bc3-fish.jpg" />

Output:

<img src="//assets.example.com/a34bc3-fish.jpg"
Release History

Release History

This version
History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-asset-server-url-0.1.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256 Source Sep 16, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting