61 lines
2.3 KiB
Python
61 lines
2.3 KiB
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""
|
||
|
|
Sync About Page Content to Database
|
||
|
|
This script updates the about_content table with the correct content
|
||
|
|
"""
|
||
|
|
import psycopg2
|
||
|
|
import json
|
||
|
|
|
||
|
|
conn = psycopg2.connect(
|
||
|
|
host='localhost',
|
||
|
|
database='prompttech',
|
||
|
|
user='prompttech_user',
|
||
|
|
password='prompttech_pass'
|
||
|
|
)
|
||
|
|
cur = conn.cursor()
|
||
|
|
|
||
|
|
# Update Hero Section
|
||
|
|
hero_content = "Founded in 2021, PromptTech Solutions has evolved from a small repair shop into a comprehensive tech solutions provider. We're here to guide you through any technology challenge—whether it's laptops, desktops, smartphones, or other devices. With expert service and personalized support, we deliver reliable solutions for all your tech needs."
|
||
|
|
|
||
|
|
cur.execute("""
|
||
|
|
UPDATE about_content
|
||
|
|
SET title = %s, subtitle = %s, content = %s
|
||
|
|
WHERE section = 'hero'
|
||
|
|
""", ("Your Trusted", "Tech Partner", hero_content))
|
||
|
|
print(f"Updated hero: {cur.rowcount} row(s)")
|
||
|
|
|
||
|
|
# Update Stats Section
|
||
|
|
stats_data = {
|
||
|
|
"stats": [
|
||
|
|
{"label": "Happy Customers", "value": "1K+"},
|
||
|
|
{"label": "Products Sold", "value": "500+"},
|
||
|
|
{"label": "Repairs Done", "value": "1,500+"},
|
||
|
|
{"label": "Satisfaction Rate", "value": "90%"}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
|
||
|
|
cur.execute("""
|
||
|
|
UPDATE about_content
|
||
|
|
SET data = %s
|
||
|
|
WHERE section = 'stats'
|
||
|
|
""", (json.dumps(stats_data),))
|
||
|
|
print(f"Updated stats: {cur.rowcount} row(s)")
|
||
|
|
|
||
|
|
# Update Story Section
|
||
|
|
story_content = """<p>PromptTech Solutions started with a simple vision: to make quality tech accessible and provide expert support that customers can trust. What began as a small phone repair shop has evolved into a full-service tech destination.</p>
|
||
|
|
<p>Our team of certified technicians brings years of combined experience in electronics repair, from smartphones to laptops and everything in between. We've helped thousands of customers bring their devices back to life.</p>
|
||
|
|
<p>Today, we're proud to offer a curated selection of premium electronics alongside our repair services. Every product we sell meets our high standards for quality, and every repair we do is backed by our satisfaction guarantee.</p>"""
|
||
|
|
|
||
|
|
cur.execute("""
|
||
|
|
UPDATE about_content
|
||
|
|
SET title = %s, content = %s
|
||
|
|
WHERE section = 'story'
|
||
|
|
""", ("Our Story", story_content))
|
||
|
|
print(f"Updated story: {cur.rowcount} row(s)")
|
||
|
|
|
||
|
|
conn.commit()
|
||
|
|
print("All content synced successfully!")
|
||
|
|
|
||
|
|
cur.close()
|
||
|
|
conn.close()
|