This is a Python web app using the Flask framework and the Azure Database for PostgreSQL relational database service. The Flask app is hosted in a fully managed Azure App Service. This app is designed to be be run locally and then deployed to Azure. For more information on how to use this web app, see the tutorial Deploy a Python (Django or Flask) web app with PostgreSQL in Azure.
If you need an Azure account, you can create on for free.
A Django sample application is also available for the article at https://github.com/Azure-Samples/msdocs-django-postgresql-sample-app.
The requirements.txt has the following packages:
Package | Description |
---|---|
Flask | Web application framework. |
SQLAlchemy | Provides a database abstraction layer to communicate with PostgreSQL. |
Flask-SQLAlchemy | Adds SQLAlchemy support to Flask application by simplifying using SQLAlchemy. Requires SQLAlchemy. |
Flask-Migrate | SQLAlchemy database migrations for Flask applications using Alembic. Allows functionality parity with Django version of this sample app. |
pyscopg2 | PostgreSQL database adapter for Python. |
python-dotenv | Read key-value pairs from .env file and set them as environment variables. In this sample app, those variables describe how to connect to the database locally. Flask's dotenv support sets environment variables automatically from an .env file. |
flask_wtf | Form rendering, validation, and CSRF protection for Flask with WTForms. Uses CSRFProtect extension. |