diff --git a/backend/aiproject/settings.py b/backend/aiproject/settings.py index 481231ad..a81e6bac 100644 --- a/backend/aiproject/settings.py +++ b/backend/aiproject/settings.py @@ -97,7 +97,7 @@ CORS_ORIGIN_WHITELIST = ALLOWED_ORIGINS -CORS_ORIGIN_ALLOW_ALL = env("CORS_ORIGIN_ALLOW_ALL", default= False) +CORS_ALLOW_ALL_ORIGINS = env("CORS_ALLOW_ALL_ORIGINS", default= False) REST_FRAMEWORK = { "DEFAULT_SCHEMA_CLASS": "rest_framework.schemas.coreapi.AutoSchema", diff --git a/backend/core/utils.py b/backend/core/utils.py index e6ed7083..cee28e22 100644 --- a/backend/core/utils.py +++ b/backend/core/utils.py @@ -127,6 +127,7 @@ def process_rawdata(file_download_url, aoi_id, feedback=False): headers = { 'Referer': 'https://fair-dev.hotosm.org/' # TODO : Use request uri } + logging.info(f"Started Processing rawdata for {aoi_id}") r = requests.get(file_download_url, headers=headers) # Check whether the export path exists or not path = "temp/" @@ -148,7 +149,7 @@ def process_rawdata(file_download_url, aoi_id, feedback=False): if fileName != "clipping_boundary.geojson": # Extract a single file from zip zipObj.extract(fileName, geojson_file_path) - print(f"""Geojson file{fileName} from API wrote to disk""") + logging.DEBUG(f"""Geojson file{fileName} from API wrote to disk""") break geojson_file = f"""{geojson_file_path}{fileName}""" process_geojson(geojson_file, aoi_id, feedback) @@ -240,7 +241,7 @@ def process_geojson(geojson_file_path, aoi_id, feedback=False): Raises: ValidationErr: _description_ """ - print("Geojson Processing Started") + logging.DEBUG("Geojson Processing Started for aoi {aoi_id} in {geojson_file_path}") if feedback: foreign_key_id = FeedbackAOI.objects.get(id=aoi_id).training else: @@ -266,4 +267,4 @@ def process_geojson(geojson_file_path, aoi_id, feedback=False): for f in tqdm(futures, total=len(data["features"])): f.result() - print("writing to database finished") + logging.DEBUG("Raw data writing to database finished")