diff --git a/app/main.py b/app/main.py index 35049e0..c14a619 100644 --- a/app/main.py +++ b/app/main.py @@ -20,7 +20,7 @@ from app.log import log, logging # Import the routers here first: from app.routers import api_crud, api, importing, sql, account, activity_log, address, archive, archive_content, contact, cont_edu_cert, cont_edu_cert_person, data_store, event, event_badge, event_badge_template, event_device, event_exhibit, event_exhibit_tracking, event_file, event_importing, event_location, event_person, event_person_detail, event_person_tracking, event_presentation, event_presenter, event_registration, event_session, flask_cfg, hosted_file, journal, journal_entry, log_client_viewing, lookup, membership_cfg, membership_group, membership_person_group, membership_person, membership_person_profile, membership_type, membership_person_type, order, order_v3, order_line, order_cart, organization, page, person, person_user, post, post_comment, product, qr, site, site_domain, user, websockets, e_cvent, c_idaa, e_impexium -from app.db_sql import db +from app.db_sql import db, sql_select print('### **** *** ** * The Aether FastAPI API is loading... * ** *** **** ###') @@ -34,16 +34,45 @@ print('### **** *** ** * The Aether FastAPI API is loading... * ** *** **** ###' app = FastAPI( - title='Aether API', - description='One Sky IT\'s Aether API using FastAPI.', - version='5.7.0', - operationsSorter='method', + title = 'Aether API', + description = 'One Sky IT\'s Aether API using FastAPI.', + version = '5.8.0', + operationsSorter = 'method', ) -@lru_cache() -def get_settings(): - return config.Settings() +log.setLevel(logging.DEBUG) +log.debug(config.settings) +if aether_cfg_sql_result := sql_select(table_name='cfg', record_id=1, as_list=False, max_count=1): + aether_cfg_sql = aether_cfg_sql_result + # log.info(config.settings.APP_NAME) + log.debug(aether_cfg_sql_result.get('name')) + config.settings.test = 'test value for test' + config.settings.DB_SERVER = aether_cfg_sql.get('db_server') + config.settings.DB_PORT = aether_cfg_sql.get('db_port') + config.settings.DB_NAME = aether_cfg_sql.get('db_name') + config.settings.DB_USERNAME = aether_cfg_sql.get('db_username') + config.settings.DB_PASSWORD = aether_cfg_sql.get('db_password') + + config.settings.SMTP['server'] = aether_cfg_sql.get('smtp_server') + config.settings.SMTP['port'] = aether_cfg_sql.get('smtp_port') + config.settings.SMTP['username'] = aether_cfg_sql.get('smtp_username') + config.settings.SMTP['password'] = aether_cfg_sql.get('smtp_password') + + # config.settings.PATH_HOSTED_FILES_ROOT = aether_cfg_sql.get('PATH_HOSTED_FILES_ROOT') + # config.settings.PATH_HOSTED_TMP_ROOT = aether_cfg_sql.get('PATH_HOSTED_TMP_ROOT') + + config.settings.FILES_PATH['hosted_files_root'] = aether_cfg_sql.get('path_hosted_files_root') + config.settings.FILES_PATH['hosted_tmp_root'] = aether_cfg_sql.get('path_hosted_tmp_root') +else: + # aether_cfg_sql_result + pass +# log.debug(aether_cfg_sql_result) +log.debug(config.settings) + +# @lru_cache() +# def get_settings(): +# return config.Settings() app.mount('/static', StaticFiles(directory='static'), name='static') diff --git a/app/routers/qr.py b/app/routers/qr.py index b0d143e..6b33cb0 100644 --- a/app/routers/qr.py +++ b/app/routers/qr.py @@ -32,10 +32,15 @@ async def get_qr( n: str = Query('', max_length=100), fn: str = Query('', max_length=100), + + title: str = Query('', max_length=100), + org: str = Query('', max_length=255), + url: str = Query('', max_length=500), email: str = Query('', max_length=255), tel: str = Query('', max_length=25), + adr: str = Query('', max_length=200), adr_poa: str = Query('', max_length=100), # Address Post Office Address adr_ext: str = Query('', max_length=100), # Address Extended Address