config issues prod
This commit is contained in:
@@ -1,7 +1,14 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||||||
from settings_dev import settings
|
|
||||||
|
# Dynamically import settings based on MODE environment variable
|
||||||
|
mode = os.environ.get('MODE', 'DEVELOPMENT').upper()
|
||||||
|
if mode == 'PRODUCTION':
|
||||||
|
from settings_prod import settings
|
||||||
|
else:
|
||||||
|
from settings_dev import settings
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from fastapi import FastAPI, HTTPException, status
|
from fastapi import FastAPI, HTTPException, status
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||||||
from settings_dev import settings
|
|
||||||
|
# Dynamically import settings based on MODE environment variable
|
||||||
|
mode = os.environ.get('MODE', 'DEVELOPMENT').upper()
|
||||||
|
if mode == 'PRODUCTION':
|
||||||
|
from settings_prod import settings
|
||||||
|
else:
|
||||||
|
from settings_dev import settings
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from fastapi import HTTPException, status
|
from fastapi import HTTPException, status
|
||||||
@@ -146,4 +152,4 @@ def get_forwardings(phone_number: str = None):
|
|||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||||
detail=f"An unexpected error occurred: {e} - Request params: {params}"
|
detail=f"An unexpected error occurred: {e} - Request params: {params}"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ class ApplicationConfig:
|
|||||||
|
|
||||||
origins = [
|
origins = [
|
||||||
"https://oil.edwineames.com",
|
"https://oil.edwineames.com",
|
||||||
|
"https://apiphone.edwineames.com",
|
||||||
"https://apiauto.edwineames.com",
|
"https://apiauto.edwineames.com",
|
||||||
|
"https://apioil.edwineames.com",
|
||||||
|
|
||||||
]
|
]
|
||||||
# VoIP.ms Credentials and Settings
|
# VoIP.ms Credentials and Settings
|
||||||
voipms_api_username = os.environ.get('VOIPMS_API_USERNAME')
|
voipms_api_username = os.environ.get('VOIPMS_API_USERNAME')
|
||||||
|
|||||||
Reference in New Issue
Block a user