summaryrefslogtreecommitdiff
path: root/src/web_api.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-10-30 01:44:04 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-10-30 01:44:04 +0300
commit3cf7eb21ec2e858aa467c9fc087fec8e8c700b6a (patch)
tree5f156391ddfd36bf05d2ab3ab6d3b2440e41d766 /src/web_api.py
parentdb784dc98ba0c4e15ee7b501d909425c79c825fb (diff)
web_api: separate appnames for dev and prod
Diffstat (limited to 'src/web_api.py')
-rwxr-xr-xsrc/web_api.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/web_api.py b/src/web_api.py
index 2a3dfcd..93d2539 100755
--- a/src/web_api.py
+++ b/src/web_api.py
@@ -4,13 +4,12 @@ import json
import os
from datetime import datetime, timedelta
-from apscheduler.schedulers.asyncio import AsyncIOScheduler
from aiohttp import web
from home import http
from home.util import parse_addr
from home.config import config, is_development_mode
-from home.database import BotsDatabase, SensorsDatabase, InverterDatabase
+from home.database import BotsDatabase, SensorsDatabase
from home.api.types import BotType, TemperatureSensorLocation, SoundSensorLocation
from home.media import SoundRecordStorage
@@ -190,7 +189,10 @@ class WebAPIServer(http.HTTPServer):
# --------------------
if __name__ == '__main__':
- config.load('web_api')
+ _app_name = 'web_api'
+ if is_development_mode():
+ _app_name += '_dev'
+ config.load(_app_name)
loop = asyncio.get_event_loop()