I have a website in Django where I want to serve favicon.ico
- which, being a static file, is in STATIC_URL/caminho/pro/favicon.ico
. Is it possible to do this directly from urls.py
? (i.e. without having to write a view just for that)
I found this answer in SOen that says how to map from one standard to another [named], but that is not what I need: I want to map from a pattern to a static URL. Something like:
url(r'^favicon.ico$', view_que_serve_a_partir_do_STATIC_ROOT_ou_redireciona_pro_STATIC_URL),
Is it possible? And if not, what would be the least laborious alternative?
P.S. I'm using Django 1.4.14, in Python 2.6.0 (and no, due to restrictions in my environment you can not upgrade to a newer version ...)