Skip to content

Commit 753a8cb

Browse files
author
Yi
committed
debug mode flask in env variables
1 parent f410c5e commit 753a8cb

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,21 @@ Project "***Minería de datos para la mejora del mantenimiento y disponibilidad
4040
export SECRET_KEY=<app secret key>
4141
export EMAIL_AC=<email>
4242
export EMAIL_PASS=<email-password>
43+
export FLASK_ENV=development #development or production
44+
export FLASK_DEBUG=1 #0 is debug=False, 1 is debug=True
4345
LIBFOLDER=/absolute/path/to/UBUMLaaS
4446
```
4547
6. With the conda environment UBUMLaaS, execute the script to export environment variables when activate conda env.
4648
```bash
47-
$ bash env_vars_to_conda.sh
49+
$ source env_vars_to_conda.sh
4850
```
49-
7. Deactivate and activate conda environment to take effect.
50-
```bash
51-
$ conda deactivate
52-
$ conda activate UBUMLaaS
53-
```
54-
8. Create database
51+
7. Create database
5552
```bash
5653
$ mv data_base.sqlite ubumlaas/data.sqlite
5754
```
5855
*Opt:*
5956
Download a database and put it in ./ubumlaas/
60-
9. Install Redis-Server
57+
8. Install Redis-Server
6158
```bash
6259
$ sudo apt install redis-server
6360
$ sudo service redis-server start

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
Main, run application.
55
"""
66
if __name__ == "__main__":
7-
create_app("main_app").run(debug = True)
7+
create_app("main_app").run()

env_variables.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
export SECRET_KEY=<app secret key>
44
export EMAIL_AC=<email>
55
export EMAIL_PASS=<email-password>
6+
export FLASK_ENV=development #development or production
7+
export FLASK_DEBUG=1 #0 is debug=False, 1 is debug=True
68
LIBFOLDER=/absolute/path/to/UBUMLaaS
79

810
export WEKA_HOME=$LIBFOLDER/lib/wekafiles/packages/

env_vars_to_conda.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
source unset_env_vars.sh
2+
source env_variables.sh
13
mkdir -p $CONDA_PREFIX/etc/conda/activate.d/
24
mkdir -p $CONDA_PREFIX/etc/conda/deactivate.d/
35
cp env_variables.sh $CONDA_PREFIX/etc/conda/activate.d/

unset_env_vars.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ unset SECRET_KEY
22
unset EMAIL_AC
33
unset EMAIL_PASS
44
unset WEKA_HOME
5-
unset MEKA_CLASSPATH
5+
unset MEKA_CLASSPATH
6+
unset FLASK_DEBUG
7+
unset FLASK_ENV

0 commit comments

Comments
 (0)