Skip to content

Commit

Permalink
Merge pull request #54 from RobsOnWaves/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
RobsOnWaves authored Jan 8, 2024
2 parents aee6a14 + e02c56b commit 5fcec6c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Code/libs/meps_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ async def load_csv_file(self, upload_file: UploadFile, answer: dict = None):
try:
timer.start()
df = pd.read_csv(temp_file_path)
df['Date'] = pd.to_datetime(df['Date'], format='%d-%m-%Y', errors='coerce')
df['Date'] = df['Date'].fillna(pd.to_datetime("01-01-1970"))
answer["df"] = df
answer["success"] = True
return answer
Expand Down
1 change: 1 addition & 0 deletions Code/libs/mongo_db_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def from_mongo_to_xlsx_meps(self):
try:
data = list(collection.find({}, {'_id': False}))
df = pd.DataFrame(data)
df['Date'] = df['Date'].dt.strftime('%d/%m/%Y')
# Création d'un fichier Excel
excel_file_path = 'meps_fichier.xlsx' # Spécifiez le chemin et le nom de fichier souhaités
df.to_excel(excel_file_path, index=False)
Expand Down
3 changes: 2 additions & 1 deletion Code/public_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def el_parametrizor(mode_debug=False):

os.environ['PWD_MONGO'] = "rootmongopwd"

os.environ['URL_FRONT'] = "http://localhost:8080"

el_parametrizor(False)

Expand Down Expand Up @@ -214,7 +215,7 @@ async def get_current_active_user(current_user: User = Depends(get_current_user)
# Configurez le middleware CORS
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:8080", "https://hedonist.exsilicium.robsonwaves.rocks"], # Les origines autorisées, vous pouvez utiliser ["*"] pour le développement
allow_origins=[os.environ['URL_FRONT']], # Les origines autorisées, vous pouvez utiliser ["*"] pour le développement
allow_credentials=True,
allow_methods=["*"], # Les méthodes HTTP autorisées
allow_headers=["*"], # Les en-têtes HTTP autorisés
Expand Down
2 changes: 2 additions & 0 deletions DevOps/apps/ged_handler/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ services:

'SECRET_KEY': "11088b752484acda51943b487d8657e142e91e085187c110e0967650e7526784"

'URL_FRONT': 'http://localhost:8080'

networks:
- ged_network

Expand Down

0 comments on commit 5fcec6c

Please sign in to comment.