Commit 7746ea34 authored by arun.uday's avatar arun.uday

AssetManager-V1.0- Not yet reviewed

Deleted conf file and added values to .env file
parent c38bd079
......@@ -2,3 +2,8 @@ MONGO_URI=mongodb://localhost:27017
DB_NAME=userDB
SERVICE_HOST=0.0.0.0
SERVICE_PORT=8671
PROJECT_NAME = AssetManager
PROJECT_ID = 1256
base_path = scripts/
sub_path = log/
ENCODING_TYPE = utf-8
\ No newline at end of file
[PROJECT_DETAILS]
PROJECT_NAME = AssetManager
PROJECT_ID = 1256
[PATH]
base_path = scripts/
sub_path = log/
[ENCODING]
ENCODING_TYPE = utf-8
\ No newline at end of file
import configparser
import pathlib
from typing import Literal
from pydantic import BaseSettings, Field
config = configparser.RawConfigParser()
config.read("conf/application.conf")
class _Services(BaseSettings):
HOST: str = Field(default="127.0.0.1", env="service_host")
PORT: int = Field(default=8000, env="service_port")
PROJECT_NAME = config.get("PROJECT_DETAILS", "PROJECT_NAME")
PROJECT_ID = config.get("PROJECT_DETAILS", "PROJECT_ID")
ENCODING_TYPE = config.get("ENCODING", "ENCODING_TYPE")
PROJECT_NAME = Field(default="AssetManager", env="project_name")
PROJECT_ID = Field(default="1256", env="project_id")
ENCODING_TYPE = Field(default="utf-8", env="encoding_type")
ENABLE_CORS: bool = True
CORS_URLS: list[str] = ["*.ilens.io"]
CORS_ALLOW_CREDENTIALS: bool = True
......
2023-03-20 14:32:44 - INFO - [MainThread:<module>(): 37] - App Starting at 0.0.0.0:8671
2023-03-20 14:39:15 - INFO - [MainThread:<module>(): 37] - App Starting at 0.0.0.0:8671
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment