diff --git a/docker/laptop-mode-env b/docker/laptop-mode-env index 7616c74e..6b174fa8 100644 --- a/docker/laptop-mode-env +++ b/docker/laptop-mode-env @@ -4,3 +4,4 @@ STRIPE_SECRET_KEY=5CEA51A5-A613-4AEF-A9FB-D0A57D77C13B GCS_BUCKET=5CEA51A5-A613-4AEF-A9FB-D0A57D77C13B GOOGLE_APPLICATION_CREDENTIALS=/dev/null DATABASE_URL=sqlite:////tmp/symposion.sqlite +SYMPOSION_DEV_MODE=LAPTOP \ No newline at end of file diff --git a/pinaxcon/devmode_settings.py b/pinaxcon/devmode_settings.py new file mode 100644 index 00000000..12bb7148 --- /dev/null +++ b/pinaxcon/devmode_settings.py @@ -0,0 +1,7 @@ +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +AUTHENTICATION_BACKENDS = [ + 'symposion.teams.backends.TeamPermissionsBackend', + 'django.contrib.auth.backends.ModelBackend', +] +LOGIN_URL='/accounts/login' + diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index 1bb945b5..4734f5fa 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -382,3 +382,8 @@ DEFAULT_FILE_STORAGE = 'gapc_storage.storage.GoogleCloudStorage' GAPC_STORAGE = { 'num_retries': 2, } + +DEV_MODE = os.environ.get("SYMPOSION_DEV_MODE", None) +if DEV_MODE and DEV_MODE == "LAPTOP": + print("ENABLING LAPTOP MODE") + from .devmode_settings import * diff --git a/pinaxcon/urls.py b/pinaxcon/urls.py index b21ec45f..35d5ce25 100644 --- a/pinaxcon/urls.py +++ b/pinaxcon/urls.py @@ -33,6 +33,9 @@ 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)