Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.49 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.49 KB

flask-psycopg2-starter

A starter kit including Flask and Psycopg2 without SQLAlchemy

Requirements

Installation

# flask-psycopg2-starter/
$ make install
[...]

Routes

# 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/<path:filename>

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,

# 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"