add poc api settings

This commit is contained in:
Laura Klünder 2024-12-28 15:59:59 +01:00
parent 0f9dcd5722
commit 5efca75f6f
2 changed files with 4 additions and 1 deletions

View file

@ -36,7 +36,7 @@ class Command(BaseCommand):
help = 'import APs from noc'
def handle(self, *args, **options):
r = requests.get(settings.POC_BASE+"antenna-locations")
r = requests.get(settings.POC_BASE+"/antenna-locations", headers={'ApiKey': settings.POC_API_SECRET})
r.raise_for_status()
items = TypeAdapter(list[PocImportItem]).validate_python(r.json())

View file

@ -223,6 +223,9 @@ if not HUB_API_SECRET:
NOC_BASE = config.get('c3nav', 'noc_base', fallback='').removesuffix('/')
NOC_LAYERS = NocLayersSchema.validate_json(config.get('c3nav', 'noc_layers', fallback='{}'))
POC_API_BASE = config.get('c3nav', 'poc_api_base', fallback='').removesuffix('/')
POC_API_SECRET = config.get('c3nav', 'poc_api_secret', fallback='')
_db_backend = config.get('database', 'backend', fallback='sqlite3')
DATABASES: dict[str, dict[str, str | int | Path]] = {
'default': env.db_url('C3NAV_DATABASE') if 'C3NAV_DATABASE' in env else {