From 5c803d8a51e5d02e3a321cc5de1ff68245f78df8 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 22 Sep 2020 18:00:28 +0300 Subject: [PATCH] Only expose drf's auth in debug mode. --- etebase_server/urls.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etebase_server/urls.py b/etebase_server/urls.py index 0c114af..fddc32f 100644 --- a/etebase_server/urls.py +++ b/etebase_server/urls.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.urls import path @@ -6,7 +7,11 @@ from django.views.generic import TemplateView urlpatterns = [ url(r'^api/', include('django_etebase.urls')), url(r'^admin/', admin.site.urls), - url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), path('', TemplateView.as_view(template_name='success.html')), ] + +if settings.DEBUG: + urlpatterns += [ + url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), + ]