Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

100 lines (80 sloc) 2.768 kB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{% load django_static %}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Test page</title>
<link rel="stylesheet" href="{% slimfile "/css/styles.css" %}" type="text/css" media="all" />
{% slimall %}
<link rel="stylesheet" href='/css/reset.css' type="text/css" />
<link rel="stylesheet" href="/css/styles.css" type="text/css">
{% endslimall %}
<style type="text/css">
{% slimcontent "css" %}
h1, h2, h3 {
font-face:'Trebuchet MS', Verdana, Arial;
}
{% endslimcontent %}
</style>
</head>
<body>
<div id="content">
<h1>Test page</h1>
<a href="http://www.peterbe.com/">
<img src="{% staticfile "/images/peterbe.jpg" %}" class="peter" alt="Proud author Peterbe" border="0" />
</a>
{% include "showicons.html" %}
{% staticall %}
<p>Some images<br/>
<img src="/images/icon1.png"/>
<img alt="Uh?" src="/images/icon2.png"/>
<img
src="/images/icon3.png"
/>
<img src="/images/deliberately_non_existant.png"/>
</p>
{% endstaticall %}
{% slimcontent %}
<h3>Benefits of django-static</h3>
<ul>
<li>
<a href="http://pypi.python.org/pypi/slimmer/">Uses slimmer</a>
</li>
<li>Full control over your static serving</li>
<li>Rewrites urls in .css files for static serving</li>
<li>Uses symbolic links to make it easy to set up aggressive caching in fronting web server (e.g. nginx)</li>
</ul>
{% endslimcontent %}
<h4>Stricken through</h4>
<h4 class="sub">Italic text</h4>
</div>
<script type="text/javascript" src="{% staticfile "/javascript/jquery-1.3.2.min.js" %}"></script>
<script type="text/javascript" src="{% slimfile "/javascript/script.js" %}"></script>
<script type="text/javascript">
{% slimcontent "js" %}
/* Example of inline Javascript */
var a = "A";
var adder = function add(a, b) {
// pointless but proves the point
return a + b;
}
{% endslimcontent %}
{% slimcontent %}
// This time it can guess it's javascript
function add(one, two) {
if (one == two) {
return one * two;
} else {
return one + two;
}
}
{% endslimcontent %}
</script>
<script src="{% slimfile "/javascript/shit_code.js" %}"></script>
{% slimall %}
<script src="/javascript/canbe.js"></script>
<script src="/javascript/combined.min.js"></script>
{% endslimall %}
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.