```
<$Partial path="api_settings.mdx" variables={{ "framework": "flask", "tab": "frameworks" }} />
## 7. Create the Supabase client [#create-the-client]
Install the `python-dotenv` package to load environment variables:
```bash
pip install python-dotenv
```
Create an `app.py` file and initialize the Flask app and the Supabase client from your environment variables.
```python name=app.py
import os
from flask import Flask
from supabase import create_client, Client
from postgrest import APIError
from dotenv import load_dotenv
load_dotenv()
app = Flask(__name__)
supabase: Client = create_client(
os.environ.get("SUPABASE_URL"),
os.environ.get("SUPABASE_PUBLISHABLE_KEY")
)
```
## 8. Query data from the app [#query-data]
Add a route to `app.py` that fetches data from your `instruments` table.
```python name=app.py
@app.route('/')
def index():
try:
response = supabase.table('instruments').select("*").execute()
except APIError as error:
return f'Error loading instruments: {error.message}
'
instruments = response.data
html = 'Instruments
'
for instrument in instruments:
html += f'- {instrument["name"]}
'
html += '
'
return html
if __name__ == '__main__':
app.run(debug=True)
```
## 9. Start the app [#start-the-app]
Run the Flask development server and go to `http://localhost:5000` in a browser. The page lists the instruments.
```bash
python app.py
```
On macOS, the page might not load because the AirPlay Receiver service uses port 5000. Turn off **AirPlay Receiver** in **System Settings > General > AirDrop & Handoff**, or run the app on another port with `app.run(debug=True, port=5001)`.
<$Partial path="quickstart_going_to_production.mdx" />
## Next steps
Build on this app with the following resources:
- Set up [Auth](/docs/guides/auth) for your app
- [Insert more data](/docs/guides/database/import-data) into your database
- Upload and serve static files using [Storage](/docs/guides/storage)