Skip to content
Snippets Groups Projects
Forked from Bo-Chun Chen / get_start_flask
31 commits behind the upstream repository.

This is a project implementing the blog post by Mbithe Nzomo.

Prerequisites

  • Python 2.7

  • virtualenv

  • Mysql

     $ brew update && brew install mysql
  • Flask

     $ pip install Flask

Resources:


Known Problems

  1. flask development mode WARNING

    $ flask run
     * Serving Flask app "run.py"
     * Environment: production
       WARNING: Do not use the development server in a production environment.
       Use a production WSGI server instead.
     * Debug mode: off

    Solution: Add environment variable FLASK_ENV and set it to development

    $ export FLASK_ENV=development
  2. ValueError when click on Assign in employees admin page

    file "APP_ROOT/venv/lib/python2.7/site-packages/wtforms/ext/sqlalchemy/fields.py", line 189, in get_pk_from_identity
    ValueError: too many values to unpack

    Solution(for now): Modify line 189 in fields.py from

    cls, key = identity_key(instance=obj)

    to

    cls, key = identity_key(instance=obj)[:2]