https://github.com/badkk/advocatehub-server
MS Hackthon2017 Proj.
https://github.com/badkk/advocatehub-server
flask gunicorn mongodb
Last synced: 3 months ago
JSON representation
MS Hackthon2017 Proj.
- Host: GitHub
- URL: https://github.com/badkk/advocatehub-server
- Owner: badkk
- Created: 2017-06-30T07:07:55.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-21T06:32:59.000Z (almost 9 years ago)
- Last Synced: 2025-03-13T06:33:30.870Z (over 1 year ago)
- Topics: flask, gunicorn, mongodb
- Language: Python
- Homepage: http://advocatehubmobile.westus.cloudapp.azure.com/
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Local Debug Steps
**MAKE SURE YOU ARE ON THE PYTHON3(<3.6) ENVIRONMENT**
### On Dev Mode
1. `pip install flask`
2. `pip install flask_cors`
3. `pip install bson`
4. `pip install pymongo`
5. `pip install pyqrcode`
6. `set FLASK_APP=advocateSimpleServer.py`
7. `flask run`(Single process mode)
8. Open browser and test REST APIs (may use Chrome extension *Restlet Client*).
### Deploy(Multiprocess Mode)
1. Choose your own uWSGI Container, you can follow the [link](http://flask.pocoo.org/docs/0.12/deploying/);
2. Using `Gunicorn` as example:
- `pip install gunicorn`
- `gunicorn -w 4 -b :13888 --log-level=debug advocateSimpleServer:app`
## Useful Links
[MongoDB Reference](https://docs.mongodb.com/manual/reference/)
[PyMongo Documentation](https://api.mongodb.com/python/current/)
[Gunicorn Documentation](http://gunicorn.org/)
## Problem Solving
1. Run Gunicorn said `'No module named flask'` like [this](https://stackoverflow.com/questions/18776745/gunicorn-with-flask-using-wrong-python)
> Maybe the gunicorn load the global pip environment which influence proj., better create the `virtualenv` to make sure you have pure pip environment;