fix(builder): robustecer arranque local y carga de themes en windows
This commit is contained in:
@@ -40,7 +40,7 @@ def handle_404(e):
|
|||||||
|
|
||||||
@app.errorhandler(Exception)
|
@app.errorhandler(Exception)
|
||||||
def handle_exception(e):
|
def handle_exception(e):
|
||||||
print(f"❌ EXCEPCIÓN: {e}")
|
print(f"ERROR: EXCEPCION: {e}")
|
||||||
return jsonify({'success': False, 'error': str(e)}), 500
|
return jsonify({'success': False, 'error': str(e)}), 500
|
||||||
|
|
||||||
# Middleware
|
# Middleware
|
||||||
@@ -51,5 +51,5 @@ def add_header(response):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(f"🚀 GKACHELE™ SaaS Modular iniciado en puerto {PORT}")
|
print(f"GKACHELE SaaS Modular iniciado en puerto {PORT}")
|
||||||
app.run(debug=True, host='0.0.0.0', port=PORT)
|
app.run(debug=True, host='0.0.0.0', port=PORT)
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ def scan_available_themes():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(config_path, 'r', encoding='utf-8') as f:
|
with open(config_path, 'r', encoding='utf-8-sig') as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
|
|
||||||
themes[theme_dir] = {
|
themes[theme_dir] = {
|
||||||
'id': theme_dir,
|
'id': theme_dir,
|
||||||
@@ -38,7 +38,7 @@ def scan_available_themes():
|
|||||||
'preview': f'/themes/{theme_dir}/preview.jpg' if os.path.exists(os.path.join(theme_path, 'preview.jpg')) else None
|
'preview': f'/themes/{theme_dir}/preview.jpg' if os.path.exists(os.path.join(theme_path, 'preview.jpg')) else None
|
||||||
}
|
}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"⚠️ Error cargando template {theme_dir}: {e}")
|
print(f"WARNING: Error cargando template {theme_dir}: {e}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
return themes
|
return themes
|
||||||
@@ -50,10 +50,10 @@ def get_theme_config(theme_id):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(config_path, 'r', encoding='utf-8') as f:
|
with open(config_path, 'r', encoding='utf-8-sig') as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"⚠️ Error cargando config de {theme_id}: {e}")
|
print(f"WARNING: Error cargando config de {theme_id}: {e}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_themes_by_rubro(rubro, user_plan='base'):
|
def get_themes_by_rubro(rubro, user_plan='base'):
|
||||||
@@ -127,7 +127,7 @@ def render_gkachele_template(theme, content, site_id=None, user_id=None):
|
|||||||
menus = get_site_menus(site_id, user_id)
|
menus = get_site_menus(site_id, user_id)
|
||||||
widgets = get_site_widgets(site_id, user_id)
|
widgets = get_site_widgets(site_id, user_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"⚠️ Error obteniendo menús/widgets: {e}")
|
print(f"WARNING: Error obteniendo menus/widgets: {e}")
|
||||||
|
|
||||||
theme_template = ''
|
theme_template = ''
|
||||||
theme_path = os.path.join(THEMES_DIR, theme, 'template.html')
|
theme_path = os.path.join(THEMES_DIR, theme, 'template.html')
|
||||||
|
|||||||
Reference in New Issue
Block a user