diff --git a/pinaxcon/devmode_settings.py b/pinaxcon/devmode_settings.py index 12bb7148..8d8a9c73 100644 --- a/pinaxcon/devmode_settings.py +++ b/pinaxcon/devmode_settings.py @@ -5,3 +5,5 @@ AUTHENTICATION_BACKENDS = [ ] LOGIN_URL='/accounts/login' +ROOT_URLCONF = "pinaxcon.devmode_urls" + diff --git a/pinaxcon/devmode_urls.py b/pinaxcon/devmode_urls.py new file mode 100644 index 00000000..0525dbff --- /dev/null +++ b/pinaxcon/devmode_urls.py @@ -0,0 +1,11 @@ +from django.conf.urls import include, url +from django.contrib.auth.views import login, logout + +from pinaxcon import urls + +urlpatterns = [ + url(r'^accounts/logout', logout, {'template_name': 'admin/logout.html'}), + url(r'^accounts/login', login, {'template_name': 'admin/login.html'}), +] + +urlpatterns += urls.urlpatterns diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index a9b67ef0..82baa7c0 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -170,7 +170,10 @@ MIDDLEWARE_CLASSES = [ 'pinaxcon.monkey_patch.MonkeyPatchMiddleware', ] -ROOT_URLCONF = "pinaxcon.urls" +if DEV_MODE and DEV_MODE == "LAPTOP": + ROOT_URLCONF = "pinaxcon.devmode_urls" +else: + ROOT_URLCONF = "pinaxcon.urls" # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = "pinaxcon.wsgi.application" diff --git a/pinaxcon/urls.py b/pinaxcon/urls.py index 34497bcc..86566ec0 100644 --- a/pinaxcon/urls.py +++ b/pinaxcon/urls.py @@ -36,9 +36,5 @@ urlpatterns = [ if settings.DEBUG: import debug_toolbar urlpatterns.insert(0, url(r'^__debug__/', include(debug_toolbar.urls))) -if settings.DEV_MODE: - from django.contrib.auth.views import login, logout - urlpatterns.insert(0, url(r'^accounts/logout', logout, {'template_name': 'admin/logout.html'})) - urlpatterns.insert(0, url(r'^accounts/login', login, {'template_name': 'admin/login.html'})) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)