A starter kit including Flask and Psycopg2 without SQLAlchemy
# flask-psycopg2-starter/
$ make install
[...]
# flask-psycopg2-starter/
$ flask routes
Endpoint Methods Rule
------------- --------- -----------------------
auth.login GET, POST /auth/#
auth.logout GET /auth/logout
auth.register GET, POST /auth/register
index GET /
static GET /static/<path:filename>
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.
If you run into permission issues like below,
# 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. Personally, I had to set following flags such that compiler can find openssl
:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"