Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dirty hax, fix dependencies #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Innometrics-backend
This is a backend implementation of innometrics. In order to run it, please, follow the steps.
# Run depoyment.sh
This script will make an environment for the project and install requirements. It will also print environment variables you would need to add to your system.

# Activate virtual environment
## Deploying and running
Use `depoyment.sh` script. It will make an environment for the project and install requirements.

Next, activate virtual environment with

`source $INNOMETRICS_BACKEND_PATH/innometricsenv/bin/activate`

# Run Flask server
`python api/app.py`
Finally,run Flask server with

`./flask.sh run`

# Run with Production environment
In order to run the app in production environment, please:
Expand Down
5 changes: 2 additions & 3 deletions deployment.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ virtualenv -p python3 innometricsenv
source innometricsenv/bin/activate
pip install -r requirements.txt

echo "Add next lines to your ~/.bashrc file"
echo "export INNOMETRICS_BACKEND_PATH=\"/srv/innometrics-backend\" # where srv is the directory you cloned the code"
echo "export PYTHONPATH=\"$INNOMETRICS_BACKEND_PATH:$INNOMETRICS_BACKEND_PATH/api:$INNOMETRICS_BACKEND_PATH/db\""
echo "Run with flask.sh, use it as a substitute for flask command"
echo "For example, to start the server, run ./flask.sh run"
8 changes: 8 additions & 0 deletions flask.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

SCRIPT_PATH=`dirname "$0"`
export INNOMETRICS_BACKEND_PATH="${SCRIPT_PATH}/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script may be executed from other folder and environment variable will wrong in that case


export FLASK_APP=serv.py

flask "$@"
14 changes: 10 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
apispec==0.39.0
asn1crypto==0.24.0
Babel==2.6.0
bcrypt==3.1.4
blinker==1.4
cffi==1.11.5
click==6.7
cryptography==2.5
Flask==1.0.2
Flask-Login==0.4.1
Flask-WTF==0.14.2
flask-mongoengine==0.9.5
flask-cors==3.0.6
gevent==1.4.0
greenlet==0.4.15
itsdangerous==0.24
Jinja2==2.10
jwt==0.5.4
MarkupSafe==1.0
marshmallow==2.15.6
mongoengine==0.15.3
PyYAML==3.13
passlib==1.7.1
pkg-resources==0.0.0
pycparser==2.18
pymongo==3.7.1
python-dateutil==2.7.3
pytz==2018.5
six==1.11.0
speaklater==1.3
Werkzeug==0.14.1
marshmallow==2.15.6
python-dateutil==2.7.3

WTForms==2.2.1
5 changes: 5 additions & 0 deletions serv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from api.app import app


if __name__ == "__main__":
app.run()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already achieved in app.py