https://github.com/cockroachdb/python-heroku-cockroachdb
A modern cloud-native web app using Python, Flask, Heroku, and CockroachDB
https://github.com/cockroachdb/python-heroku-cockroachdb
cloud-native cockroachdb flask heroku html python sqlalchemy
Last synced: 9 days ago
JSON representation
A modern cloud-native web app using Python, Flask, Heroku, and CockroachDB
- Host: GitHub
- URL: https://github.com/cockroachdb/python-heroku-cockroachdb
- Owner: cockroachdb
- License: apache-2.0
- Created: 2022-04-08T13:31:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-04T15:57:11.000Z (almost 3 years ago)
- Last Synced: 2025-06-13T14:02:35.997Z (13 days ago)
- Topics: cloud-native, cockroachdb, flask, heroku, html, python, sqlalchemy
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 7
- Watchers: 48
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Using CockroachDB with a Python + Flask App
Build a full-stack web app that simulates a game leaderboard using the simplicity of Python with a Flask web development framework. The corresponding blog post is available via [https://www.cockroachlabs.com/blog/sample-app-python-and-cockroachdb/](https://www.cockroachlabs.com/blog/sample-app-python-and-cockroachdb/).
The Flask web framework works in the application’s backend. It relies on Jinja2 as a rich templating engine for the frontend to render HTML when users request web pages. This application connects to CockroachDB via Serverless using SQLAlchemy, an open source object-relational mapper for the Python language. Finally, we use Heroku to deploy the sample app, where everything works exactly the same as on the local system.
To run the app, clone or fork the code into your own GitHub repo, use the repo to create a new Heroku app, set the DB_URI variable in Heroku to a Postgres connection string, and then deploy.