In this project I have made a webpage that will take an email address as an input and show us the "Email Username", "Email Domain" and "Suggested Username". I have used Flask as backend, the website will be hosted on a local server, which we can view in any browser.
In setup, you have to install flask and set up a virtual environment having all the required dependencies. Everything is explained on the Flask website :
Files needed here are inside "myproject" folder as mentioned on the above linked webpage.(Please follow all the steps mentioned on the flask website and then come back and continue.)
This is our main Python file. The email-slicer code is here and the result or returned output is going to be displayed on our website.
#Below lines of my Python file are the most important.
email = email.strip() #getting rid of unnecessary spaces
email1 = email.split("@")[0] #splitting the string at '@" symbol
domain = email.split("@")[1] #assigning domain address to a variable
This is the folder where we will keep our Html files. I have only used one page i.e. "index.html". You can have more.
This is the folder where you can put files that you would like to add in your website. I have an image i.e. "bg.jpg" which is used as the background for my html file. I also have a 'styles.css' file that is used for styling.
Let's look at how the website looks and functions.