diff --git a/README.md b/README.md index 5bece3eb695ff0f50598019e8d79142744f11d7d..c434544dd0805605606bc4afe299a567a2206dd8 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ This is a project implementing the blog post by Mbithe Nzomo. - [Part two](https://scotch.io/tutorials/build-a-crud-web-app-with-python-and-flask-part-two) - [Part three](https://scotch.io/tutorials/build-a-crud-web-app-with-python-and-flask-part-three) -And might add some of the feature from [The Flask Mega-Tutorial](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world). -The following list is some of the features might be used for User Portal: + And might add some of the feature from [The Flask Mega-Tutorial](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world). + The following list is some of the features might be used for User Portal: - [Chapter 2: Templates](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-ii-templates) - [Chapter 10: Email Support](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-x-email-support) @@ -32,3 +32,41 @@ The following list is some of the features might be used for User Portal: - [Chapter 19: Deployment on Docker Containers](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xix-deployment-on-docker-containers) - [Chapter 22: Background Jobs](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xxii-background-jobs) - [Chapter 23: APIs](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xxiii-application-programming-interfaces-apis) + +----- +### Known Problems +1. flask development mode WARNING + + ```shell + $ 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 + + ```shell + $ export FLASK_ENV=development + ``` + +2. ValueError when click on Assign in employees admin page + + ```shell + 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 + + ```shell + cls, key = identity_key(instance=obj) + ``` + to + ```shell + cls, key = identity_key(instance=obj)[:2] + ```