Speeds up non-media requests

Django was running _refresh_dev_names on every request (including API and epublisher requests).

This patch will only run it when using the {% include_media %} which speeds up site performance.