Posts

Redirecting to another page with button click in Python-flask

Image
  Redirecting to another page with  click in Python-flask Flask is a backend server that is built entirely using Python. It is a  framework that consists of  Python  packages and modules. It is lightweight which makes developing backend applications quicker with its features. Suppose we have to attach any html page Link in any webpage in python  < a class ="dropdown-item" href = "{{ url_for('terms') }}" >< span class ="item-text" > Terms Conditions </ span ></ a > < div class ="dropdown-items-divide-hr" ></ div > < a class ="dropdown-item" href = "{{ url_for('privacy') }}" >< span class ="item-text" > Privacy Policy </ span ></ a > Redirect to a URL in Flask A redirect is used in the Flask class to send the user to a particular URL with the status code. conversely, this status code additionally identifies the issue. When we ac...

Web application using Flask

Image
  Web application using Flask and deploy it to the cloud It makes the process of designing a web application simpler. Flask lets us focus on what the  users are requesting and what sort of response to give back. How Does a Flask App Work? The code lets us run a basic web application that we can serve, as if it were a website. from flask import Flask app = Flask ( __name__ ) @app . route ( "/" ) def home ( ) : return "Hello, World!" if __name__ == "__main__" : app . run ( debug = True ) This piece of code is stored in our main.py. Line 1:  Here we are importing the Flask module and creating a Flask web server from the Flask module. Line 3: __name__ means this current file . In this case, it will be main.py. This current file will represent my web application. We are creating an instance of the Flask class and calling it app. Here we are creating a new web application. Line 5:  It represents the default page. For example, if I go t...