Snippet List
By default the `runserver` command does some magic to automatically serve admin media. This magic doesn't happen when using other servers like gunicorn… But this makes that magic unnecessary by using urls.py to route requests for admin media to the standard static media server.
`#include <production_disclaimer.h>`
For example:
Last modified: {% localdt item.modified_utc %} ({% localtimesince time.modified_utc %})
Converts the input datetimes to the timezone specified by the localtz context variable (it can also be explicitly specified, and all those other sensible things).
Input UTC datetimes can be specified using either a datetime or a timestamp.
Provides `localdt`, `localtime`, `localdate` and `localtimesince`.
Accepts the same arguments as the 'range' builtin and creates
a list containing the result of 'range'.
Syntax:
{% mkrange [start,] stop[, step] as context_name %}
For example:
{% mkrange 5 10 2 as some_range %}
{% for i in some_range %}
{{ i }}: Something I want to repeat\n
{% endfor %}
Produces:
5: Something I want to repeat
7: Something I want to repeat
9: Something I want to repeat
wolever has posted 5 snippets.