- Replace Next.js/React implementation with Python Flask - Add colorful blue-purple-teal gradient theme replacing red design - Integrate logo and Transalpina panoramic background image - Implement complete authentication system with Flask-Login - Add community features for stories and tracks sharing - Create responsive design with Tailwind CSS - Add error handling with custom 404/500 pages - Include Docker deployment configuration - Add favicon support and proper SEO structure - Update content for Pensiune BuonGusto accommodation - Remove deprecated Next.js files and dependencies Features: ✅ Landing page with hero section and featured content ✅ User registration and login system ✅ Community section for adventure sharing ✅ Admin panel for content management ✅ Responsive mobile-first design ✅ Docker containerization with PostgreSQL ✅ Email integration with Flask-Mail ✅ Form validation with WTForms ✅ SQLAlchemy database models ✅ Error pages and favicon handling
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
from flask import Blueprint, render_template, request, redirect, url_for, flash
|
|
from flask_login import login_required, current_user
|
|
from app.models import Post, PostImage, GPXFile, User, db
|
|
from werkzeug.utils import secure_filename
|
|
from werkzeug.exceptions import RequestEntityTooLarge
|
|
import os
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
main = Blueprint('main', __name__)
|
|
|
|
@main.route('/')
|
|
def index():
|
|
"""Landing page with about, accommodation, and community sections"""
|
|
return render_template('index.html')
|
|
|
|
@main.route('/favicon.ico')
|
|
def favicon():
|
|
"""Serve favicon"""
|
|
return redirect(url_for('static', filename='favicon.ico'))
|
|
|
|
@main.route('/health')
|
|
def health_check():
|
|
"""Health check endpoint"""
|
|
return {'status': 'healthy', 'timestamp': datetime.utcnow().isoformat()}
|
|
|
|
@main.app_errorhandler(404)
|
|
def not_found_error(error):
|
|
return render_template('errors/404.html'), 404
|
|
|
|
@main.app_errorhandler(500)
|
|
def internal_error(error):
|
|
db.session.rollback()
|
|
return render_template('errors/500.html'), 500
|
|
|
|
@main.app_errorhandler(RequestEntityTooLarge)
|
|
def file_too_large(error):
|
|
flash('File is too large. Maximum file size is 16MB.', 'error')
|
|
return redirect(request.url)
|