From deed30cff0ef6f50e7a9ff60db2ce09d19ad1260 Mon Sep 17 00:00:00 2001 From: FriggemannMichael Date: Wed, 8 Jul 2026 12:59:14 +0200 Subject: [PATCH] Move base-info endpoint into its own app Relocate the base-info API out of the core project package into a dedicated base_info_app, so core only holds project configuration. The URL name stays 'base-info', so no callers change. Register the new app, point the api include at it, move its tests, and extend the architecture test's expected app list. --- README.md | 3 ++- {core/api => base_info_app}/__init__.py | 0 base_info_app/api/__init__.py | 0 {core => base_info_app}/api/urls.py | 0 {core => base_info_app}/api/views.py | 0 base_info_app/apps.py | 7 +++++++ base_info_app/tests/__init__.py | 0 {core => base_info_app}/tests/test_base_info_endpoint.py | 0 core/settings.py | 1 + core/tests/test_app_architecture.py | 1 + core/urls.py | 2 +- 11 files changed, 12 insertions(+), 2 deletions(-) rename {core/api => base_info_app}/__init__.py (100%) create mode 100644 base_info_app/api/__init__.py rename {core => base_info_app}/api/urls.py (100%) rename {core => base_info_app}/api/views.py (100%) create mode 100644 base_info_app/apps.py create mode 100644 base_info_app/tests/__init__.py rename {core => base_info_app}/tests/test_base_info_endpoint.py (100%) diff --git a/README.md b/README.md index 059f3a3..1289c1f 100644 --- a/README.md +++ b/README.md @@ -111,12 +111,13 @@ user can be created with: ## Project structure -- `core/` — Django project configuration and the base-info endpoint +- `core/` — Django project configuration - `auth_app/` — registration and login - `profiles_app/` — user profiles - `offers_app/` — offers and offer details - `orders_app/` — orders and order counters - `reviews_app/` — reviews and ratings +- `base_info_app/` — aggregated platform statistics (base-info endpoint) - `docs/` — endpoint reference and delivery checklist ## Running checks diff --git a/core/api/__init__.py b/base_info_app/__init__.py similarity index 100% rename from core/api/__init__.py rename to base_info_app/__init__.py diff --git a/base_info_app/api/__init__.py b/base_info_app/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/api/urls.py b/base_info_app/api/urls.py similarity index 100% rename from core/api/urls.py rename to base_info_app/api/urls.py diff --git a/core/api/views.py b/base_info_app/api/views.py similarity index 100% rename from core/api/views.py rename to base_info_app/api/views.py diff --git a/base_info_app/apps.py b/base_info_app/apps.py new file mode 100644 index 0000000..9bf4690 --- /dev/null +++ b/base_info_app/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class BaseInfoAppConfig(AppConfig): + """Configure the base info app.""" + + name = 'base_info_app' diff --git a/base_info_app/tests/__init__.py b/base_info_app/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/tests/test_base_info_endpoint.py b/base_info_app/tests/test_base_info_endpoint.py similarity index 100% rename from core/tests/test_base_info_endpoint.py rename to base_info_app/tests/test_base_info_endpoint.py diff --git a/core/settings.py b/core/settings.py index 6c69bf9..60d4749 100644 --- a/core/settings.py +++ b/core/settings.py @@ -60,6 +60,7 @@ def _env_list(name, default=''): 'offers_app', 'orders_app', 'reviews_app', + 'base_info_app', ] MIDDLEWARE = [ diff --git a/core/tests/test_app_architecture.py b/core/tests/test_app_architecture.py index 51a4cf8..11f9e96 100644 --- a/core/tests/test_app_architecture.py +++ b/core/tests/test_app_architecture.py @@ -11,6 +11,7 @@ 'offers_app', 'orders_app', 'reviews_app', + 'base_info_app', ] EXPECTED_API_URL_MODULES = [ diff --git a/core/urls.py b/core/urls.py index 2b4175f..9af9c6e 100644 --- a/core/urls.py +++ b/core/urls.py @@ -15,5 +15,5 @@ path('api/', include('offers_app.api.urls')), path('api/', include('orders_app.api.urls')), path('api/', include('reviews_app.api.urls')), - path('api/', include('core.api.urls')), + path('api/', include('base_info_app.api.urls')), ]