aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authortom christie tom@tomchristie.com2011-03-09 08:50:56 +0000
committertom christie tom@tomchristie.com2011-03-09 08:50:56 +0000
commitc25f8f8427da13a969afab700aebb00d87d60838 (patch)
treef5482d86ac8e2e880c9c2caee0335fc396ca7eb4 /examples
parentf8eb5a75d23b8e759c34c61e4a5561e725cde2c7 (diff)
downloaddjango-rest-framework-c25f8f8427da13a969afab700aebb00d87d60838.tar.bz2
fix #27
Diffstat (limited to 'examples')
-rw-r--r--examples/urls.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/urls.py b/examples/urls.py
index 03894e4e..7cb5e7ce 100644
--- a/examples/urls.py
+++ b/examples/urls.py
@@ -1,9 +1,9 @@
from django.conf.urls.defaults import patterns, include, url
+from django.conf import settings
from sandbox.views import Sandbox
urlpatterns = patterns('djangorestframework.views',
(r'robots.txt', 'deny_robots'),
- (r'favicon.ico', 'favicon'),
(r'^$', Sandbox.as_view()),
@@ -17,3 +17,11 @@ urlpatterns = patterns('djangorestframework.views',
(r'^accounts/login/$', 'api_login'),
(r'^accounts/logout/$', 'api_logout'),
)
+
+# Only serve favicon in production because otherwise chrome users will pretty much
+# permanantly have the django-rest-framework favicon whenever they navigate to
+# 127.0.0.1:8000 or whatever, which gets annoying
+if not settings.DEBUG:
+ urlpatterns += patterns('djangorestframework.views',
+ (r'favicon.ico', 'favicon'),
+ )