mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-20 13:48:16 +02:00
feat: add debug script to display search site configurations and database entries
This commit is contained in:
1 parent
5d7f872dae
commit
b47af1655d
3 files changed
+148
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add app to path
|
||||
sys.path.append(os.getcwd())
|
||||
|
||||
from app.core.database import SessionLocal
|
||||
from app.models import SearchSite
|
||||
from app.core.search_config import SITE_CONFIGS
|
||||
|
||||
def debug_sites():
|
||||
db = SessionLocal()
|
||||
try:
|
||||
print("=== SITE_CONFIGS Keys ===")
|
||||
for key in SITE_CONFIGS.keys():
|
||||
print(f"- {key}")
|
||||
|
||||
print("\n=== DB SearchSites ===")
|
||||
sites = db.query(SearchSite).all()
|
||||
for site in sites:
|
||||
print(f"ID: {site.id} | Name: {site.name} | Domain: {site.domain} | Active: {site.is_active}")
|
||||
print(f" URL: {site.search_url}")
|
||||
print(f" Selector: {site.product_link_selector}")
|
||||
print("-" * 20)
|
||||
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
debug_sites()
|
||||
Reference in new issue
Block a user