Category: Python Flask

Build a Flask application to validate CAPTCHA

In this article, we are going a build a web application that can have a CAPTCHA. CAPTCHA is a tool you can use to differentiate between real users and automated users. CAPTCHAs are usually found on the login pages or on payment pages.What is CAPTCHA?Captcha is strategy used to ensure sites against spam. Objective is […]

Continue Reading

Covid Vaccine Availability using Flask Server

from flask import Flask,request,session,render_templateimport requests,timefrom datetime import datetime,timedelta  app = Flask(__name__)  @app.route(‘/’)def home():    return render_template(“index.html”)  @app.route(‘/CheckSlot’)def check():            pin = request.args.get(“pincode”)              age = request.args.get(“age”)    data = list()              result = findSlot(age,pin,data)          if(result == 0):        return render_template(“noavailable.html”)     return render_template(“slot.html”,data = data)  def findSlot(age,pin,data):    flag = ‘y’    num_days =  2    actual = datetime.today()    list_format = [actual + timedelta(days=i) for i in range(num_days)]    actual_dates = [i.strftime(“%d-%m-%Y”) for i in list_format]              while True:        counter = 0        for given_date in actual_dates:                                    header = […]

Continue Reading

Twitter Sentiment Analysis WebApp Using Flask

from flask import Blueprint, render_template, requestimport matplotlib.pyplot as pltimport os  import tweepyimport csvimport refrom textblob import TextBlobimport matplotlibmatplotlib.use(‘agg’)  second = Blueprint(“second”, __name__, static_folder=”static”,                   template_folder=”template”)  @second.route(“/sentiment_analyzer”)def sentiment_analyzer():    return render_template(“sentiment_analyzer.html”)    class SentimentAnalysis:      def __init__(self):        self.tweets = []        self.tweetText = []          def DownloadData(self, keyword, tweets):                  consumerKey = ‘//get from Tweepy’        consumerSecret = ‘//get from Tweepy’        accessToken = ‘//insert your access token here’        accessTokenSecret = ‘//Tweepy AccessToken secret here’        auth = tweepy.OAuthHandler(consumerKey, consumerSecret)        auth.set_access_token(accessToken, accessTokenSecret)        api […]

Continue Reading

Flask vs Django – Which Framework Should You Choose?

Python is a powerful language with an amazing set of tools to make life a lot less simple for python developers. But when it comes to web frameworks, Flask and Django are the most preferred ones. Web frameworks are collections of packages and modules that make it easier to write web applications, without focusing on […]

Continue Reading

How to use Flask-Session in Python Flask ?

How to use Flask-Session in Python Flask ? Flask Session –  Flask-Session is an extension for Flask that support Server-side Session to your application. The Session is the time between the client logs in to the server and logs out of the server. The data that is required to be saved in the Session is […]

Continue Reading