Move api router registration to app ready
This commit is contained in:
parent
9b2c2156c7
commit
1dd2717ff2
2 changed files with 8 additions and 8 deletions
|
|
@ -7,8 +7,14 @@ class FroideGovPlanConfig(AppConfig):
|
|||
verbose_name = _("GovPlan App")
|
||||
|
||||
def ready(self):
|
||||
from froide.api import api_router
|
||||
from froide.follow.configuration import follow_registry
|
||||
|
||||
from .api_views import GovernmentPlanViewSet
|
||||
from .configuration import GovernmentPlanFollowConfiguration
|
||||
|
||||
follow_registry.register(GovernmentPlanFollowConfiguration())
|
||||
|
||||
api_router.register(
|
||||
r"governmentplan", GovernmentPlanViewSet, basename="governmentplan"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue