Skip to content

derejmi/Flask_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Study Notes

Python as a Backend: Flask

Exercises

  1. Create a Flask API

    • You can choose what it does!
    • Your API should respond to at least one GET and one POST request
    • Add at least one extension eg. a database connection or an email service
    • Follow documentation to add some tests using pytest
  2. Prepare a short (3-5 minute) demonstration of your new API

    • Focus on demonstrating your API's functionality
    • You could demonstrate using curl, Hoppscotch, a custom client or a combination!

Run Demo

  • cd flask-demo
  • pipenv install -r requirements.txt
  • pipenv shell
  • Tell terminal which application to work with:
    • export FLASK_APP=server.py (Linux/MacOS/GitBash)
    • set FLASK_APP=server.py (Windows Command Prompt)
    • $env:FLASK_APP = "server.py" (PowerShell)
  • Tell terminal which environment to work in:
    • export FLASK_ENV=development (Linux/MacOS/GitBash)
    • set FLASK_ENV=development (Windows Command Prompt)
    • $env:FLASK_ENV="development" (PowerShell)
  • flask run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages