https://github.com/recrsn/flask-sqlalchemy-starter
Bare minimum starter template using Flask and SQLAlchemy.
https://github.com/recrsn/flask-sqlalchemy-starter
flask python sqlalchemy
Last synced: about 1 month ago
JSON representation
Bare minimum starter template using Flask and SQLAlchemy.
- Host: GitHub
- URL: https://github.com/recrsn/flask-sqlalchemy-starter
- Owner: recrsn
- Created: 2021-04-04T07:54:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-04T08:02:07.000Z (about 5 years ago)
- Last Synced: 2025-10-24T23:08:05.466Z (8 months ago)
- Topics: flask, python, sqlalchemy
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flask SQLAlchemy Starter
Bare minimum starter template using Flask and SQLAlchemy.
## Installation
### Requirements
- python 3.6 +
- Pipenv for dependency management
## Usage
1. Clone this repository
2. Copy `.env.example` to `.env` and modify the required values.
2. Rename the `flask_sqlalchemy_starter` folder to your package name.
3. Add/remove models
4. Create migrations using `flask db migrate`
5. Apply migrations to database using `flask db upgrade`
6. Run tests with `pytest -v tests`
## Configuring database
You can use any SQLAlchemy compatible URI string for the database. By default, the template uses a SQLite database.
To use a different database like Postgres, edit the `DATABASE_URI` accordingly and install the appropriate python
package to connect to the DB.
### Postgres
1. Run `pipenv install psycopg2`
2. Edit `DATABASE_URI` to `postgres://:@:5432/`
### MySQL
1. Run `pipenv install mysql-connector`
2. Edit `DATABASE_URI` to `mysql://:@:3306/`