In this article, we will create an online resume builder web app. We will start by filling out a form with our personal information. Once the form is completed, we can generate a resume. Additionally, we will ensure the PDF generation quality to make the final result closely resemble the original resume in a professional and proper format. To use this service, you only need to input your information and submit the form.
Note:Developing a resume builder is an excellent way to practice Django. For those looking to expand their knowledge, the Django Web Development Course covers advanced techniques that can help refine your skills.
Setting up Necessary files
home/views.py
The given code in Python handles two web pages: "home" and "gen_resume." The "home" view renders an HTML template named 'index.html' when the user accesses it. The "gen_resume" view is used to generate a resume and handles POST requests containing form data. The view collects data from the POST request and then renders an HTML template named 'resume.html' with the collected data passed as context to the template.
This HTML code creates a structured form for gathering personal information, skills, educational history, and work experience, and it is styled using CSS for a visually appealing user interface.
HTML
<!DOCTYPE html><html><head><style>body{font-family:Arial,sans-serif;}.form-container{width:60%;margin:0auto;padding:20px;border:1pxsolid#ccc;border-radius:5px;}.form-group{margin-bottom:15px;}.form-grouplabel{display:block;font-weight:bold;}.form-groupinput[type="text"],.form-grouptextarea{width:100%;padding:10px;border:1pxsolid#ccc;border-radius:5px;}.form-grouptextarea{height:100px;}/* Apply styles to the skills input elements */.om{width:100%;padding:10px20px;display:flex;gap:10px;}.ed{width:100%;padding:10px20px;display:flex;gap:4%;}.com{width:80%;padding:5px20px;display:flex;gap:7%;}.op{margin:10px;}.btn1{margin-left:43%;padding:15px15px;font-size:15px;font-weight:bold;background-color:rgb(35,144,208);border-radius:10px;}/* You can add more styles as needed */</style></head><body><h1style="text-align: center; color:green; font-size:40px; ">GeeksforGeeks</h1><formaction="{% url 'resume' %}"method="post">
{% csrf_token %}
<!-- ===================PERSONAL INFORMATION====================== --><divclass="form-container"><h2>Personal Information</h2><divclass="form-group"><labelfor="name">Name:</label><inputtype="text"id="name"name="name"></div><divclass="form-group"><labelfor="name">About:</label><inputtype="text"id="name"name="about"></div><divclass="form-group"><labelfor="age">Age:</label><inputtype="text"id="age"name="age"></div><divclass="form-group"><labelfor="email">Email:</label><inputtype="text"id="email"name="email"></div><divclass="form-group"><labelfor="phone">Phone:</label><inputtype="text"id="phone"name="phone"></div><divclass="form-group "><labelfor="skills">Skills:</label><divclass="om"><inputtype="text"id="skills"name="skill1"><inputtype="text"id="skills"name="skill2"><inputtype="text"id="skills"name="skill3"><inputtype="text"id="skills"name="skill4"><inputtype="text"id="skills"name="skill5"></div></div><!-- =====================EDUCATION SECTION ================== --><!-- -----EDUCATION 1----- --><divclass="form-group"><labelfor="education1">Education 1:</label></div><divclass="ed"><divclass="form-group"><labelfor="degree1">Degree :</label><inputtype="text"id="degree1"name="degree1"></div><divclass="form-group"><labelfor="college1">College :</label><inputtype="text"id="college1"name="college1"></div><divclass="form-group"><labelfor="year1">Year :</label><inputtype="text"id="year1"name="year1"></div></div><!-- -----EDUCATION 2----- --><divclass="form-group"><labelfor="education1">Education 2:</label></div><divclass="ed"><divclass="form-group"><labelfor="degree1">Degree:</label><inputtype="text"id="degree1"name="degree2"></div><divclass="form-group"><labelfor="college1">College:</label><inputtype="text"id="college1"name="college2"></div><divclass="form-group"><labelfor="year1">Year:</label><inputtype="text"id="year1"name="year2"></div></div><!-- -----EDUCATION 3----- --><divclass="form-group"><labelfor="education1">Education 3:</label></div><divclass="ed"><divclass="form-group"><labelfor="degree1">Degree:</label><inputtype="text"id="degree1"name="degree3"></div><divclass="form-group"><labelfor="college1">College:</label><inputtype="text"id="college1"name="college3"></div><divclass="form-group"><labelfor="year1">Year:</label><inputtype="text"id="year1"name="year3"></div></div><!-- ================LANGUAGAES======================= --><divclass="form-group "><labelfor="skills">Languages :</label><divclass="om"><inputtype="text"id="skills"name="lang1"><inputtype="text"id="skills"name="lang2"><inputtype="text"id="skills"name="lang3"></div></div><!-- =====================PROJECT SECTION=================== --><!-- PROJECT 1 --><divclass="form-group"><labelfor="experience1">Project 1 :</label></div><divclass="com"><divclass="form-group "><labelfor="company1">Project Title :</label><inputtype="text"id="company1"name="project1"></div><divclass="form-group"><labelfor="post1">Duration :</label><inputtype="text"id="post1"name="durat1"></div></div><divclass="form-group"><labelfor="description1">Description :</label><inputtype="text"id="duration1"name="desc1"></div><!-- PROJECT 2 --><divclass="form-group"><labelfor="experience1">Project 2 :</label></div><divclass="com"><divclass="form-group "><labelfor="company1">Project Title :</label><inputtype="text"id="company1"name="project2"></div><divclass="form-group"><labelfor="post1">Duration :</label><inputtype="text"id="post1"name="durat2"></div></div><divclass="form-group"><labelfor="description1">Description :</label><inputtype="text"id="duration1"name="desc2"></div><!-- =======================EXPERICNECE SECTION===================== --><divclass="form-group"><labelfor="experience1">Experience 1:</label></div><divclass="com"><divclass="form-group "><labelfor="company1">Company Name :</label><inputtype="text"id="company1"name="company1"></div><divclass="form-group"><labelfor="post1">Post :</label><inputtype="text"id="post1"name="post1"></div><divclass="form-group"><labelfor="duration1">Duration :</label><inputtype="text"id="duration1"name="duration1"></div></div><divclass="form-group "><labelfor="description1">Description :</label><divclass="op"><inputtype="text"id="duration1"name="lin11"></div></div><divclass="form-group"><labelfor="experience1">Experience 2:</label></div><divclass="com"><divclass="form-group "><labelfor="company1">Company Name :</label><inputtype="text"id="company1"name="company2"></div><divclass="form-group"><labelfor="post1">Post :</label><inputtype="text"id="post1"name="post2"></div><divclass="form-group"><labelfor="duration1">Duration :</label><inputtype="text"id="duration1"name="duration2"></div></div><divclass="form-group"><labelfor="description1">Description :</label><inputtype="text"id="duration1"name="lin21"></div><!-- ==========================ACHIEVEMENT================= --><divclass="form-group"><labelfor="experience1">Achievement :</label></div><divclass="form-group "><labelfor="company1">First :</label><inputtype="text"id="company1"name="ach1"></div><divclass="form-group"><labelfor="post1">Second :</label><inputtype="text"id="post1"name="ach2"></div><divclass="form-group"><labelfor="duration1">Third :</label><inputtype="text"id="duration1"name="ach3"></div><buttontype="submit"class=" btn1 ">Submit</button></div></form></body></html>
templates/resume.html
This HTML code is a structured template for creating a personal resume or CV. Additionally, there's a JavaScript code snippet at the bottom that defines the myfun function. This function is responsible for generating and printing the resume when the button is clicked.
The provided code is configuring URL patterns for a Django web application. It includes mappings for two URLs: the root URL, which is associated with the 'home' view rendering the website's homepage, and a '/resume/' URL, which maps to the 'gen_resume' view for generating a resume. These URL patterns make up the application's routing, allowing users to access specific views based on the URLs they visit. The 'name' parameter provides a way to reference these patterns throughout the application.