https://github.com/bwdmonkey/flask-psycopg2-starter
a flask psycopg2 server without SQLAlchemy
https://github.com/bwdmonkey/flask-psycopg2-starter
flask postgresql psycopg2 starter-kit
Last synced: about 1 year ago
JSON representation
a flask psycopg2 server without SQLAlchemy
- Host: GitHub
- URL: https://github.com/bwdmonkey/flask-psycopg2-starter
- Owner: bwdmonkey
- Created: 2019-05-13T19:26:19.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T20:34:32.000Z (about 3 years ago)
- Last Synced: 2025-04-07T11:11:08.616Z (about 1 year ago)
- Topics: flask, postgresql, psycopg2, starter-kit
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 5
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flask-psycopg2-starter
A starter kit including Flask and Psycopg2 without SQLAlchemy
## Requirements
- `Python>=3.7.3` [General](https://www.python.org/downloads/release/python-373/)
- `PostgreSQL>=11.2` [General](https://www.postgresql.org/download/) [macOS](https://postgresapp.com/)
## Installation
```bash
# flask-psycopg2-starter/
$ make install
[...]
```
## Routes
```bash
# flask-psycopg2-starter/
$ flask routes
Endpoint Methods Rule
------------- --------- -----------------------
auth.login GET, POST /auth/login
auth.logout GET /auth/logout
auth.register GET, POST /auth/register
index GET /
static GET /static/
```
## Production
If you are starting with this boilerplate to build an application for prod deployment, there is a `serve.py` that wraps the Flask application with a basic logger.
## Issues
If you run into permission issues like below,
```bash
# flask-psycopg2-starter/
$ make install
virtualenv venv
make: ./make-venv: Permission denied
make: *** [install] Error 1
$ chmod +x make-venv # should fix the issue
```
If you run into issues installing `psycopg2` on macOS, refer to [this StackOverflow post](https://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa). Personally, I had to set following flags such that compiler can find `openssl`:
``` bash
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
```