项目作者: bwdmonkey

项目描述 :
a flask psycopg2 server without SQLAlchemy
高级语言: Python
项目地址: git://github.com/bwdmonkey/flask-psycopg2-starter.git
创建时间: 2019-05-13T19:26:19Z
项目社区:https://github.com/bwdmonkey/flask-psycopg2-starter

开源协议:

下载


flask-psycopg2-starter

A starter kit including Flask and Psycopg2 without SQLAlchemy

Requirements

Installation

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

Routes

  1. # flask-psycopg2-starter/
  2. $ flask routes
  3. Endpoint Methods Rule
  4. ------------- --------- -----------------------
  5. auth.login GET, POST /auth/login
  6. auth.logout GET /auth/logout
  7. auth.register GET, POST /auth/register
  8. index GET /
  9. 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,

  1. # flask-psycopg2-starter/
  2. $ make install
  3. virtualenv venv
  4. make: ./make-venv: Permission denied
  5. make: *** [install] Error 1
  6. $ 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:

  1. export LDFLAGS="-L/usr/local/opt/openssl/lib"
  2. export CPPFLAGS="-I/usr/local/opt/openssl/include"