```
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/<category>') def category(category): categories = { "technology": { "category_name": "Technology & Engineering", "careers": [ {"name": "Software Developer", "link": "/technology/software-developer"}, {"name": "Data Scientist", "link": "/technology/data-scientist"}, {"name": "Mechanical Engineer", "link": "/technology/mechanical-engineer"} ] }, "health": { "category_name": "Health & Life Sciences", "careers": [ {"name": "Doctor", "link": "/health/doctor"}, {"name": "Nurse", "link": "/health/nurse"}, {"name": "Biologist", "link": "/health/biologist"} ] }, "business": { "category_name": "Business, Finance & Law", "careers": [ {"name": "Business Analyst", "link": "/business/business-analyst"}, {"name": "Lawyer", "link": "/business/lawyer"}, {"name": "Accountant", "link": "/business/accountant"} ] }, "arts": { "category_name": "Arts, Media & Design", "careers": [ {"name": "Graphic Designer", "link": "/arts/graphic-designer"}, {"name": "Film Director", "link": "/arts/film-director"}, {"name": "Musician", "link": "/arts/musician"} ] }, "education": { "category_name": "Education & Social Impact", "careers": [ {"name": "Teacher", "link": "/education/teacher"}, {"name": "Social Worker", "link": "/education/social-worker"}, {"name": "Non-Profit Manager", "link": "/education/nonprofit-manager"} ] } } return render_template('category.html', **categories[category]) @app.route('/<category>/<career>') def career(category, career): career_details = { "software-developer": { "career_name": "Software Developer", "description": "Software developers create applications and systems that run on computers and devices.", "articles": [{"title": "Software Engineer Career Path", "url": "https://careerfoundry.com/blog/web-development/software-engineer-career-path/"}], "try_this": "Build a simple web application using HTML, CSS, and Python Flask." }, "data-scientist": { "career_name": "Data Scientist", "description": "Data scientists analyze large datasets to discover insights and build predictive models.", "articles": [{"title": "How to Become a Data Scientist", "url": "https://codefirstgirls.com/blog/how-to-become-a-data-scientist/"}], "try_this": "Create a data visualization project using Python and Matplotlib." }, "mechanical-engineer": { "career_name": "Mechanical Engineer", "description": "Mechanical engineers design and build machines and mechanical systems for various industries.", "articles": [{"title": "Mechanical Engineering Careers", "url": "https://research.com/careers/mechanical-engineering-careers"}], "try_this": "Design a simple mechanical system using a CAD tool like Fusion 360." }, "doctor": { "career_name": "Doctor", "description": "Doctors diagnose and treat illnesses, working in hospitals, clinics, or private practice.", "articles": [{"title": "Physician Career Track", "url": "https://doctorly.org/career-track/physician/"}], "try_this": "Volunteer at a local clinic or hospital to gain experience." }, "nurse": { "career_name": "Nurse", "description": "Nurses provide medical care and support to patients in various healthcare settings.", "articles": [{"title": "Nursing Career Pathways", "url": "https://www.nursingworld.org/content-hub/resources/becoming-a-nurse/nursing-career-pathways/"}], "try_this": "Shadow a nurse to learn about patient care in different settings." }, "biologist": { "career_name": "Biologist", "description": "Biologists study living organisms, their environments, and their interactions.", "articles": [{"title": "Biology Career Guide", "url": "https://www.learnhowtobecome.org/science-technology-careers/biology/"}], "try_this": "Conduct a small experiment to observe plant growth under different conditions." }, "business-analyst": { "career_name": "Business Analyst", "description": "Business analysts help organizations improve processes and make data-driven decisions.", "articles": [{"title": "Business Analyst Career Guide", "url": "https://www.theforage.com/blog/careers/business-analyst"}], "try_this": "Analyze a small dataset and create a report with recommendations for improvement." }, "lawyer": { "career_name": "Lawyer", "description": "Lawyers provide legal advice, represent clients in court, and draft legal documents.", "articles": [{"title": "Lawyer Career Path", "url": "https://careerkarma.com/blog/lawyer-career-path/"}], "try_this": "Research a recent court case and summarize its outcome." }, "accountant": { "career_name": "Accountant", "description": "Accountants manage financial records, prepare taxes, and ensure compliance with regulations.", "articles": [{"title": "Accounting Career Guide", "url": "https://www.franklin.edu/blog/accounting-mvp/accounting-career-path"}], "try_this": "Create a simple budget for a personal project and track expenses." }, "graphic-designer": { "career_name": "Graphic Designer", "description": "Graphic designers create visual content for digital and print media.", "articles": [{"title": "Graphic Design Career Path", "url": "https://www.fifteendesign.co.uk/blog/graphic-design-career-path-and-progression/"}], "try_this": "Design a poster for a local event using Canva or Adobe Illustrator." }, "film-director": { "career_name": "Film Director", "description": "Film directors oversee the creative aspects of film production, including casting and editing.", "articles": [{"title": "Film Director Career Guide", "url": "https://www.princetonreview.com/careers/65/film-director"}], "try_this": "Create a short film using your smartphone and video editing software." }, "musician": { "career_name": "Musician", "description": "Musicians compose, perform, and produce music in various genres and settings.", "articles": [{"title": "Career Ideas for Musicians", "url": "https://www.stagesmusicarts.com/career-ideas-for-musicians/"}], "try_this": "Write and record a short song using free tools like GarageBand or Audacity." } } if career in career_details: return render_template('career.html', **career_details[career]) else: return "Career details not found." if __name__ == '__main__': app.run(debug=True) mentor_requests = [] # Temporary storage for mentor requests @app.route('/mentor-form/<career>', methods=['GET', 'POST']) def mentor_form(career): if request.method == 'POST': name = request.form['name'] email = request.form['email'] message = request.form['message'] mentor_requests.append({"name": name, "email": email, "career": career, "message": message}) print(f"Mentor Request: {name} ({email}) - Career: {career} - Message: {message}") return render_template('thank_you.html', name=name) return render_template('mentor_form.html', career=career)
```