add poc api settings
This commit is contained in:
parent
0f9dcd5722
commit
5efca75f6f
2 changed files with 4 additions and 1 deletions
|
@ -36,7 +36,7 @@ class Command(BaseCommand):
|
||||||
help = 'import APs from noc'
|
help = 'import APs from noc'
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
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()
|
r.raise_for_status()
|
||||||
items = TypeAdapter(list[PocImportItem]).validate_python(r.json())
|
items = TypeAdapter(list[PocImportItem]).validate_python(r.json())
|
||||||
|
|
||||||
|
|
|
@ -223,6 +223,9 @@ if not HUB_API_SECRET:
|
||||||
NOC_BASE = config.get('c3nav', 'noc_base', fallback='').removesuffix('/')
|
NOC_BASE = config.get('c3nav', 'noc_base', fallback='').removesuffix('/')
|
||||||
NOC_LAYERS = NocLayersSchema.validate_json(config.get('c3nav', 'noc_layers', fallback='{}'))
|
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')
|
_db_backend = config.get('database', 'backend', fallback='sqlite3')
|
||||||
DATABASES: dict[str, dict[str, str | int | Path]] = {
|
DATABASES: dict[str, dict[str, str | int | Path]] = {
|
||||||
'default': env.db_url('C3NAV_DATABASE') if 'C3NAV_DATABASE' in env else {
|
'default': env.db_url('C3NAV_DATABASE') if 'C3NAV_DATABASE' in env else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue