aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/urls.py
diff options
context:
space:
mode:
authorTom Christie2011-05-04 09:21:17 +0100
committerTom Christie2011-05-04 09:21:17 +0100
commitd373b3a067796b8e181be9368fa24e89c572c45e (patch)
treeeec24eb8f8813ce959511c3572a54c5ee645e227 /djangorestframework/urls.py
parent8756664e064a18afc4713d921c318cd968f18433 (diff)
downloaddjango-rest-framework-d373b3a067796b8e181be9368fa24e89c572c45e.tar.bz2
Decouple views and resources
Diffstat (limited to 'djangorestframework/urls.py')
-rw-r--r--djangorestframework/urls.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/djangorestframework/urls.py b/djangorestframework/urls.py
new file mode 100644
index 00000000..271b0215
--- /dev/null
+++ b/djangorestframework/urls.py
@@ -0,0 +1,16 @@
+from django.conf.urls.defaults import patterns
+from django.conf import settings
+
+urlpatterns = patterns('djangorestframework.utils.staticviews',
+ (r'robots.txt', 'deny_robots'),
+ (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.utils.staticviews',
+ (r'favicon.ico', 'favicon'),
+ ) \ No newline at end of file