Skip to content

apps.py and urls.py — App Config and URL Registration #41

@whisper67265

Description

@whisper67265

Problem

The boost_weblate Django app currently lacks a proper AppConfig and URL routing. Without apps.py, Django cannot auto-discover the app or run its ready() hook. Without urls.py, the boost endpoint has no route table and cannot be mounted into Weblate's URL namespace. These two files are prerequisites for the DRF views (views.py) and for operators who need to wire the plugin into their Weblate deployment.

Acceptance Criteria

  • src/boost_weblate/apps.py defines a BoostWeblateConfig(AppConfig) with name = "boost_weblate", a human-readable verbose_name, and a default_auto_field
  • AppConfig.ready() performs any one-time initialization (e.g., signal registration) or is left as a clean no-op with a docstring explaining future use
  • src/boost_weblate/urls.py defines a urlpatterns list with routes for the boost endpoint (at minimum: GET /info/ and POST /add-or-update/)
  • The route table uses DRF's path() or re_path() and maps to view classes/functions defined in views.py
  • The app namespace is set (app_name = "boost_weblate") so that reverse("boost_weblate:info") works
  • README.md documents how the operator includes the URL conf (e.g., path("boost/", include("boost_weblate.urls")))

Implementation Notes

Week 20 research concluded that AppConfig.ready() + ROOT_URLCONF override is the preferred URL registration approach. The urls.py route table should be kept minimal: mount info and add-or-update under a single prefix. Use app_name for namespace isolation. Keep the URL patterns stable since they will be documented in the API docs (William's item).

References

  • Related files: src/boost_weblate/apps.py, src/boost_weblate/urls.py, src/boost_weblate/__init__.py
  • Depends on: Plugin integration validation (this week), Week 20 URL registration research

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions