datatracker/ietf/api/apps.py
Jennifer Richards 95a7e14ada
feat: dev mode admin + refactor api init (#7628)
* feat: style admin site in dev mode

* refactor: eliminate base_site.html

* fix: remove debug

* fix: commit missing __init__.py

* refactor: make method static; fix tests

* refactor: move api init to AppConfig.ready()

Avoids interacting with the app registry before
it's ready.
2024-08-07 09:16:40 -05:00

16 lines
476 B
Python

from django.apps import AppConfig
from . import populate_api_list
class ApiConfig(AppConfig):
name = "ietf.api"
def ready(self):
"""Hook to do init after the app registry is fully populated
Importing models or accessing the app registry is ok here, but do not
interact with the database. See
https://docs.djangoproject.com/en/4.2/ref/applications/#django.apps.AppConfig.ready
"""
populate_api_list()