From 3587f497034c4946182a068d61dc61f5e9785355 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 17 Aug 2026 15:54:33 -0700 Subject: [PATCH] django: Changes for new import path Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- freedombox/migrations/0002_modulestore.py | 2 +- .../0003_merge_firstboot_completed_fields.py | 2 +- freedombox/migrations/0004_userprofile.py | 2 +- .../migrations/0005_storednotification.py | 2 +- freedombox/migrations/0006_userpasskey.py | 2 +- freedombox/settings.py | 28 ++++++++++--------- freedombox/tests/data/django_test_settings.py | 6 ++-- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/freedombox/migrations/0002_modulestore.py b/freedombox/migrations/0002_modulestore.py index 43b81c064..69ff718c9 100644 --- a/freedombox/migrations/0002_modulestore.py +++ b/freedombox/migrations/0002_modulestore.py @@ -8,7 +8,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('plinth', '0001_initial'), + ('freedombox', '0001_initial'), ] operations = [ diff --git a/freedombox/migrations/0003_merge_firstboot_completed_fields.py b/freedombox/migrations/0003_merge_firstboot_completed_fields.py index b413c24f4..a395fafc2 100644 --- a/freedombox/migrations/0003_merge_firstboot_completed_fields.py +++ b/freedombox/migrations/0003_merge_firstboot_completed_fields.py @@ -59,7 +59,7 @@ def merge_firstboot_finished_fields(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('plinth', '0002_modulestore'), + ('freedombox', '0002_modulestore'), ] operations = [ diff --git a/freedombox/migrations/0004_userprofile.py b/freedombox/migrations/0004_userprofile.py index 1214f62cc..679d9bd54 100644 --- a/freedombox/migrations/0004_userprofile.py +++ b/freedombox/migrations/0004_userprofile.py @@ -24,7 +24,7 @@ def truncate_user_profile(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('plinth', '0003_merge_firstboot_completed_fields'), + ('freedombox', '0003_merge_firstboot_completed_fields'), ] operations = [ diff --git a/freedombox/migrations/0005_storednotification.py b/freedombox/migrations/0005_storednotification.py index 715c3aaff..6850ba6cd 100644 --- a/freedombox/migrations/0005_storednotification.py +++ b/freedombox/migrations/0005_storednotification.py @@ -15,7 +15,7 @@ from freedombox.models import JSONField class Migration(migrations.Migration): dependencies = [ - ('plinth', '0004_userprofile'), + ('freedombox', '0004_userprofile'), ] operations = [ diff --git a/freedombox/migrations/0006_userpasskey.py b/freedombox/migrations/0006_userpasskey.py index b32b228bb..91788541c 100644 --- a/freedombox/migrations/0006_userpasskey.py +++ b/freedombox/migrations/0006_userpasskey.py @@ -16,7 +16,7 @@ class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('plinth', '0005_storednotification'), + ('freedombox', '0005_storednotification'), ] operations = [ diff --git a/freedombox/settings.py b/freedombox/settings.py index 6493ecbed..f6a548230 100644 --- a/freedombox/settings.py +++ b/freedombox/settings.py @@ -127,7 +127,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'oauth2_provider', 'stronghold', - 'plinth', + 'freedombox', ] # Overridden based on configuration key use_x_forwarded_host @@ -137,7 +137,7 @@ IPWARE_META_PRECEDENCE_ORDER = ('REMOTE_ADDR', ) LANGUAGES = [('en', 'English')] # A list of directories where Django looks for translation files. -LOCALE_PATHS = ['plinth/locale'] +LOCALE_PATHS = ['freedombox/locale'] # Overridden by log configuration in log.py LOGGING = {'version': 1} @@ -150,7 +150,7 @@ LOGIN_REDIRECT_URL = 'index' MESSAGE_TAGS: dict = {} MIDDLEWARE = ( - 'plinth.middleware.CommonHeadersMiddleware', + 'freedombox.middleware.CommonHeadersMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', @@ -159,12 +159,12 @@ MIDDLEWARE = ( 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'plinth.middleware.CommonErrorMiddleware', + 'freedombox.middleware.CommonErrorMiddleware', 'stronghold.middleware.LoginRequiredMiddleware', - 'plinth.middleware.AdminRequiredMiddleware', - 'plinth.middleware.FirstSetupMiddleware', - 'plinth.modules.first_boot.middleware.FirstBootMiddleware', - 'plinth.middleware.SetupMiddleware', + 'freedombox.middleware.AdminRequiredMiddleware', + 'freedombox.middleware.FirstSetupMiddleware', + 'freedombox.modules.first_boot.middleware.FirstBootMiddleware', + 'freedombox.middleware.SetupMiddleware', # AxesMiddleware should be the last middleware. It only formats user # lockout messages and renders Axes lockout responses on failed user @@ -173,8 +173,10 @@ MIDDLEWARE = ( ) OAUTH2_PROVIDER = { - 'OIDC_ENABLED': True, - 'OAUTH2_VALIDATOR_CLASS': 'plinth.modules.oidc.validators.OAuth2Validator', + 'OIDC_ENABLED': + True, + 'OAUTH2_VALIDATOR_CLASS': + 'freedombox.modules.oidc.validators.OAuth2Validator', 'SCOPES': { 'openid': _('Uniquely identify your user account with username'), @@ -188,13 +190,13 @@ OAUTH2_PROVIDER = { } PASSWORD_HASHERS = [ - 'plinth.hashers.Argon2PasswordHasherLowMemory', + 'freedombox.hashers.Argon2PasswordHasherLowMemory', 'django.contrib.auth.hashers.PBKDF2PasswordHasher', 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', 'django.contrib.auth.hashers.BCryptSHA256PasswordHasher', ] -ROOT_URLCONF = 'plinth.urls' +ROOT_URLCONF = 'freedombox.urls' SECURE_CONTENT_TYPE_NOSNIFF = True @@ -231,7 +233,7 @@ TEMPLATES = [ 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages', - 'plinth.context_processors.common', + 'freedombox.context_processors.common', ], }, }, diff --git a/freedombox/tests/data/django_test_settings.py b/freedombox/tests/data/django_test_settings.py index 9808b00b8..ec313467d 100644 --- a/freedombox/tests/data/django_test_settings.py +++ b/freedombox/tests/data/django_test_settings.py @@ -37,7 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'oauth2_provider', 'stronghold', - 'plinth', + 'freedombox', ] # These are included here solely to suppress Django warnings @@ -48,7 +48,7 @@ MIDDLEWARE = ( 'django.contrib.messages.middleware.MessageMiddleware', ) -ROOT_URLCONF = 'plinth.tests.data.urls' +ROOT_URLCONF = 'freedombox.tests.data.urls' SECRET_KEY = 'django_tests_secret_key' @@ -57,7 +57,7 @@ STRONGHOLD_PUBLIC_URLS = (r'^/o/', ) TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, - 'DIRS': ['plinth/tests/data/templates/'], + 'DIRS': ['freedombox/tests/data/templates/'], }] TIME_ZONE = 'UTC'