From 70c4af40f0ac692b8f66164b0e9e20725a8cfefd Mon Sep 17 00:00:00 2001 From: Jason Bau Date: Wed, 22 May 2013 10:55:21 -0700 Subject: [PATCH 1/2] add MITX Feature setting to enable django admin site --- lms/urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/urls.py b/lms/urls.py index 3b14b41bd7..d1bee076fc 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -8,7 +8,7 @@ from . import one_time_startup import django.contrib.auth.views # Uncomment the next two lines to enable the admin: -if settings.DEBUG: +if settings.DEBUG or settings.MITX_FEATURES.get('ENABLE_DJANGO_ADMIN_SITE'): admin.autodiscover() urlpatterns = ('', # nopep8 @@ -330,7 +330,7 @@ if settings.COURSEWARE_ENABLED: if settings.ENABLE_JASMINE: urlpatterns += (url(r'^_jasmine/', include('django_jasmine.urls')),) -if settings.DEBUG: +if settings.DEBUG or settings.MITX_FEATURES.get('ENABLE_DJANGO_ADMIN_SITE'): ## Jasmine and admin urlpatterns += (url(r'^admin/', include(admin.site.urls)),) From 5fc8469a81cbabf3203bbac383d35219dd132fd0 Mon Sep 17 00:00:00 2001 From: Jason Bau Date: Wed, 22 May 2013 11:45:42 -0700 Subject: [PATCH 2/2] add example in lms/envs/common.py --- lms/envs/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lms/envs/common.py b/lms/envs/common.py index 3c133a1e6b..efed3f7c7f 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -72,6 +72,7 @@ MITX_FEATURES = { 'ENABLE_PSYCHOMETRICS': False, # real-time psychometrics (eg item response theory analysis in instructor dashboard) + 'ENABLE_DJANGO_ADMIN_SITE': False, # set true to enable django's admin site, even on prod (e.g. for course ops) 'ENABLE_SQL_TRACKING_LOGS': False, 'ENABLE_LMS_MIGRATION': False, 'ENABLE_MANUAL_GIT_RELOAD': False,