Skip to content

ShubhPatil95/Flask_Outputs_Methods

Repository files navigation

Flask_Outputs_Methods

In this repository I have mentioned about some methods by which we can show our outputs of flask app. These methods would proof very handy in the development and testing phase of app and will reduce your depedancy on front end team for interface development.

Please refer below sections and follow the step by step approach.

01-Constant_Inputs.py

Here in this section we can see how flask app will work taking the constant inputs

  • Create a folder Flask_App and move into same
mkdir Flask_App
cd Flask_App
touch 01-Constant_Inputs.py
  • Run a file 01-Constant_Inputs.py in spyder or run through command line interface
python3 01-Constant_Inputs.py

02-Inputs_Through_URL.py

Here in this section we will see how can we pass inputs through URL

  • Create a folder Flask_App and move into same
mkdir Flask_App
cd Flask_App
touch 02-Inputs_Through_URL.py
  • Run a file 02-Inputs_Through_URL.py in spyder or run through command line interface
python3 02-Inputs_Through_URL.py

Alt text

  • Now you can read and try to understand code written in 02-Inputs_Through_URL.py and for any questions feel free to reach out to me on linkedin Shubham Patil

03-Inputs_Through_Swagger.py

Here in this section we will use swagger to pass inputs to app, which would be very convinient in development phase

  • Create a folder Flask_App and move into same
mkdir Flask_App
cd Flask_App
touch 03-Inputs_Through_Swagger.py
  • Run a file 03-Inputs_Through_Swagger.py in spyder or run through command line interface
python3 03-Inputs_Through_Swagger.py
  • Click below URL's to open swagger.
    Click Here To Go To Swagger

  • Click On [addition] or [substraction] drop down=> click on [Try it Out] => Enter First and Second number=> Click [Execute] => Check output in [Response body]
    Click Here To Go To Swagger
    Alt text

  • Now you can read and try to understand code written in 03-Inputs_Through_Swagger.py and for any questions feel free to reach out to me on linkedin Shubham Patil

04-Inputs_Through_HTML.py

Here in this section we will see how to connect HTML page with flask app to take inputs and show outputs

  • Create a folder Flask_App and move into same
mkdir Flask_App
cd Flask_App
touch 04-Inputs_Through_HTML.py
  • Create a folder templates and create a file index.html and copy paste code from index.html
mkdir templates
cd mkdir 
touch index.html
  • Run a file 04-Inputs_Through_HTML.py in spyder or run through command line interface
python3 04-Inputs_Through_HTML.py
  • Click below URL's to open swagger.
    Click Here To Open App URL

  • On App page, Enter First and Second number and then enter SUM or SUB for addition and substraction respectively. Alt text

  • Now you can read and try to understand code written in 04-Inputs_Through_HTML.py and for any questions feel free to reach out to me on linkedin Shubham Patil

Among above methods we can choose any one to see our app output while developing any flask application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published