Skip to content

bwdmonkey/flask-psycopg2-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

About

a flask psycopg2 server without SQLAlchemy

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published