Spaces:
Runtime error
Runtime error
Inder-26 commited on
Commit ·
2d7183c
1
Parent(s): add681a
Fix data ingestion path, update README images, and enable reload
Browse files- README.md +5 -1
- app.py +1 -1
- debug.txt +0 -0
- images/home_page_1.png +3 -0
- images/home_page_2.png +3 -0
- images/home_page_3.png +3 -0
- images/home_page_4.png +3 -0
- images/home_page_5.png +3 -0
- networksecurity/components/data_ingestion.py +10 -2
README.md
CHANGED
|
@@ -10,7 +10,11 @@ license: mit
|
|
| 10 |
|
| 11 |
# 🛡️ Network Security System: Phishing URL Detection
|
| 12 |
|
| 13 |
-

|
| 14 |
+

|
| 15 |
+

|
| 16 |
+

|
| 17 |
+

|
| 18 |
|
| 19 |
## 📋 Table of Contents
|
| 20 |
|
app.py
CHANGED
|
@@ -605,5 +605,5 @@ if __name__ == "__main__":
|
|
| 605 |
"app:app",
|
| 606 |
host="0.0.0.0",
|
| 607 |
port=8000,
|
| 608 |
-
reload=
|
| 609 |
)
|
|
|
|
| 605 |
"app:app",
|
| 606 |
host="0.0.0.0",
|
| 607 |
port=8000,
|
| 608 |
+
reload=True
|
| 609 |
)
|
debug.txt
DELETED
|
Binary file (24 Bytes)
|
|
|
images/home_page_1.png
ADDED
|
Git LFS Details
|
images/home_page_2.png
ADDED
|
Git LFS Details
|
images/home_page_3.png
ADDED
|
Git LFS Details
|
images/home_page_4.png
ADDED
|
Git LFS Details
|
images/home_page_5.png
ADDED
|
Git LFS Details
|
networksecurity/components/data_ingestion.py
CHANGED
|
@@ -46,11 +46,19 @@ class DataIngestion:
|
|
| 46 |
import logging
|
| 47 |
logging.info(f"MongoDB unavailable, using sample CSV: {str(e)}")
|
| 48 |
try:
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
logging.info(f" Loaded {len(df)} rows from CSV")
|
| 51 |
return df
|
| 52 |
except FileNotFoundError:
|
| 53 |
-
raise NetworkSecurityException("Sample CSV not found at
|
| 54 |
|
| 55 |
|
| 56 |
def export_data_into_feature_store(self, dataframe: pd.DataFrame):
|
|
|
|
| 46 |
import logging
|
| 47 |
logging.info(f"MongoDB unavailable, using sample CSV: {str(e)}")
|
| 48 |
try:
|
| 49 |
+
# Construct absolute path relative to this script file
|
| 50 |
+
# Script is in networksecurity/components/data_ingestion.py
|
| 51 |
+
# Root is 2 levels up from current_dir (components)
|
| 52 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 53 |
+
root_dir = os.path.dirname(os.path.dirname(current_dir))
|
| 54 |
+
csv_path = os.path.join(root_dir, "Network_data", "phisingData.csv")
|
| 55 |
+
|
| 56 |
+
logging.info(f"MongoDB unavailable. Attempting to load CSV from: {csv_path}")
|
| 57 |
+
df = pd.read_csv(csv_path)
|
| 58 |
logging.info(f" Loaded {len(df)} rows from CSV")
|
| 59 |
return df
|
| 60 |
except FileNotFoundError:
|
| 61 |
+
raise NetworkSecurityException(f"Sample CSV not found at {csv_path}. CWD: {os.getcwd()}", sys)
|
| 62 |
|
| 63 |
|
| 64 |
def export_data_into_feature_store(self, dataframe: pd.DataFrame):
|