From e699fc617e5ffdca3a4dea7833dcb83685e899c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Sat, 14 Oct 2017 17:15:51 +0200 Subject: [PATCH] Move authentication-related modules to app `bocal_auth` --- bocal/settings_base.py | 3 ++- bocal/urls.py | 2 +- bocal_auth/__init__.py | 0 bocal_auth/admin.py | 3 +++ bocal_auth/apps.py | 5 +++++ {mainsite => bocal_auth}/cas_backend.py | 0 bocal_auth/migrations/__init__.py | 0 bocal_auth/tests.py | 3 +++ mainsite/auth_views.py => bocal_auth/views.py | 0 9 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 bocal_auth/__init__.py create mode 100644 bocal_auth/admin.py create mode 100644 bocal_auth/apps.py rename {mainsite => bocal_auth}/cas_backend.py (100%) create mode 100644 bocal_auth/migrations/__init__.py create mode 100644 bocal_auth/tests.py rename mainsite/auth_views.py => bocal_auth/views.py (100%) diff --git a/bocal/settings_base.py b/bocal/settings_base.py index 22ff30a..2c2858e 100644 --- a/bocal/settings_base.py +++ b/bocal/settings_base.py @@ -32,6 +32,7 @@ INSTALLED_APPS = [ 'django_cas_ng', 'mainsite', 'api', + 'bocal_auth', ] MIDDLEWARE = [ @@ -87,7 +88,7 @@ AUTH_PASSWORD_VALIDATORS = [ AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', - 'mainsite.cas_backend.BOcalCASBackend', + 'bocal_auth.cas_backend.BOcalCASBackend', ] CAS_ADMIN_PREFIX = '/yaes5eiS' # we don't want CAS to take over /admin auth diff --git a/bocal/urls.py b/bocal/urls.py index 0645196..e423159 100644 --- a/bocal/urls.py +++ b/bocal/urls.py @@ -19,7 +19,7 @@ from django.contrib.auth.decorators import login_required import django.contrib.auth.views as dj_auth_views import mainsite.urls -import mainsite.auth_views as auth_views +import bocal_auth.views as auth_views import markdownx.urls import api.urls diff --git a/bocal_auth/__init__.py b/bocal_auth/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bocal_auth/admin.py b/bocal_auth/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/bocal_auth/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/bocal_auth/apps.py b/bocal_auth/apps.py new file mode 100644 index 0000000..08a0faa --- /dev/null +++ b/bocal_auth/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AuthConfig(AppConfig): + name = 'bocal_auth' diff --git a/mainsite/cas_backend.py b/bocal_auth/cas_backend.py similarity index 100% rename from mainsite/cas_backend.py rename to bocal_auth/cas_backend.py diff --git a/bocal_auth/migrations/__init__.py b/bocal_auth/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bocal_auth/tests.py b/bocal_auth/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/bocal_auth/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/mainsite/auth_views.py b/bocal_auth/views.py similarity index 100% rename from mainsite/auth_views.py rename to bocal_auth/views.py