import os from flask import Flask, request, render_template_string app = Flask(__name__) SKIN_DATA = { "Normal": { "makeup": "Natural look with light foundation and subtle blush.", "products": "Gentle cleanser, hydrating moisturizer, and SPF protection." }, "Dry": { "makeup": "Hydrating foundation, cream blush, and dewy finish products.", "products": "Hydrating cleanser, intense moisturizer, nourishing oils." }, "Oily": { "makeup": "Mattifying foundation, powder blush, and oil-control products.", "products": "Foaming cleanser, oil-free moisturizer, mattifying primers." }, "Combination": { "makeup": "Balanced foundation for T-zone and cheeks, versatile blush.", "products": "Gentle cleanser, balancing moisturizer, lightweight sunscreen." }, "Sensitive": { "makeup": "Hypoallergenic and fragrance-free makeup products.", "products": "Fragrance-free cleanser, soothing moisturizer, calming serums." } } HTML_TEMPLATE = ''' Recomendación de Maquillaje y Cuidado de Piel

¿Cuál es tu tipo de piel?

{% if recommendations %}

Recomendaciones para piel {{ selected }}:

Maquillaje: {{ recommendations.makeup }}

Cuidado de la piel: {{ recommendations.products }}

{% endif %}
''' @app.route('/', methods=['GET', 'POST']) def home(): selected = None recommendations = None if request.method == 'POST': selected = request.form.get('skin_type') if selected in SKIN_DATA: recommendations = SKIN_DATA[selected] return render_template_string( HTML_TEMPLATE, skin_types=SKIN_DATA.keys(), selected=selected, recommendations=recommendations ) if __name__ == '__main__': app.run(host='0.0.0.0', port=int(os.environ.get("PORT", 5000)), debug=True)