From a7eeb4388e0a5f702ff75e23446d8524fccc638f Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 02:55:20 +0300 Subject: [PATCH 01/16] solve for build-status --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c9ed0e..961ef08 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ [![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=project-app)](https://travis-ci.com/hogum/storeManager) #[![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=project-app)](https://travis-ci.com/hogum/storeManager) [![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=master)](https://travis-ci.com/hogum/storeManager) -[![Coverage Status](https://coveralls.io/repos/github/hogum/storeManager/badge.svg?branch=project-app)](https://coveralls.io/github/hogum/storeManager?branch=project-app) + +[![Coverage Status](https://coveralls.io/repos/github/hogum/storeManager/badge.svg)](https://coveralls.io/github/hogum/storeManager) [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/hogum/storeManager) From 916b0ce3998c3f2f6d1c0a860857130f20b11404 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 02:57:09 +0300 Subject: [PATCH 02/16] solve for build-status --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 961ef08..aef9d29 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # storeManager [![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=project-app)](https://travis-ci.com/hogum/storeManager) -#[![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=project-app)](https://travis-ci.com/hogum/storeManager) [![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=master)](https://travis-ci.com/hogum/storeManager) [![Coverage Status](https://coveralls.io/repos/github/hogum/storeManager/badge.svg)](https://coveralls.io/github/hogum/storeManager) From a4fa71392e653fb468e29eef91d811d1f6515b40 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 16:47:50 +0300 Subject: [PATCH 03/16] set up to Initialize app --- app/__init__.py | 13 +++++++++++++ requirements.txt | 1 + 2 files changed, 14 insertions(+) diff --git a/app/__init__.py b/app/__init__.py index e69de29..fa84e67 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -0,0 +1,13 @@ +import os +from flask import Flask + +# Initialize application +my_app = Flask(__name__, static_folder="") + +# app configuration +my_app_settings = os.getenv( + 'APP_SETTINGS', + 'my_app.config.DevelopmentConfig' +) +my_app.config.from_object(my_app_settings) + diff --git a/requirements.txt b/requirements.txt index 5a4f142..a1918d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ docopt==0.6.2 Flask==1.0.2 Flask-HTTPAuth==3.2.4 Flask-RESTful==0.3.6 +gunicorn==19.9.0 idna==2.7 itsdangerous==0.24 Jinja2==2.10 From 1bb8aefda800f366b4165d3d2f5ec32663e4c3cf Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 16:53:20 +0300 Subject: [PATCH 04/16] initial deploy --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..982d380 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn app:my_app From 6f4d3a2d3661496d59cb934527426dae24d7bb9d Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 17:15:32 +0300 Subject: [PATCH 05/16] resolve for app initialzation --- app/__init__.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index fa84e67..5c41953 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,13 +1,8 @@ -import os -from flask import Flask -# Initialize application -my_app = Flask(__name__, static_folder="") +from flask import Flask -# app configuration -my_app_settings = os.getenv( - 'APP_SETTINGS', - 'my_app.config.DevelopmentConfig' -) -my_app.config.from_object(my_app_settings) +# Define the application object +my_app = Flask(__name__) +# Configurations +my_app.config.from_object('config') From 2eed8839ffc2009f385e6747b5e048246d25cc52 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 17:25:31 +0300 Subject: [PATCH 06/16] resolve for app initialzation --- app/__init__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 5c41953..e69de29 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,8 +0,0 @@ - -from flask import Flask - -# Define the application object -my_app = Flask(__name__) - -# Configurations -my_app.config.from_object('config') From da735f482712435767d81af59bc4eec164a3928a Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 17:41:45 +0300 Subject: [PATCH 07/16] Coverage config --- .travis.yml | 7 ++----- requirements.txt | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 598acde..417b403 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,9 @@ cache: pip install: - pip install -r requirements.txt + script: - - coverage run -m pytest - - py.test --cov=project + - py.test coveralls/tests.py --doctest-modules --pep8 coveralls -v --cov coveralls --cov-report term-missing after_success: - coveralls - -script: - - pytest diff --git a/requirements.txt b/requirements.txt index a1918d5..97444a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ aniso8601==3.0.2 certifi==2018.10.15 chardet==3.0.4 Click==7.0 -coverage==4.5.1 +coverage==4.0.3 coveralls==1.5.1 docopt==0.6.2 Flask==1.0.2 @@ -13,7 +13,9 @@ idna==2.7 itsdangerous==0.24 Jinja2==2.10 MarkupSafe==1.0 +python-coveralls==2.9.1 pytz==2018.5 +PyYAML==3.13 requests==2.20.0 six==1.11.0 urllib3==1.24 From 2cf3d087842ce0afe9c55af4e90dd013f80a81f7 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 17:50:48 +0300 Subject: [PATCH 08/16] Coverage config --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 417b403..a1be49e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,9 @@ cache: pip install: - pip install -r requirements.txt - script: - - py.test coveralls/tests.py --doctest-modules --pep8 coveralls -v --cov coveralls --cov-report term-missing + - coverage run -m pytest + - py.test --cov=app after_success: - coveralls From 72081f7101dbb2a0224842d84e3c588966dd776e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 17:57:30 +0300 Subject: [PATCH 09/16] Coverage issue solved --- .coverage | 1 + requirements.txt | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .coverage diff --git a/.coverage b/.coverage new file mode 100644 index 0000000..573ee9d --- /dev/null +++ b/.coverage @@ -0,0 +1 @@ +!coverage.py: This is a private format, don't read it directly!{"lines":{"/root/Documents/save_me/storeManager/app/__init__.py":[1],"/root/Documents/save_me/storeManager/app/tests/__init__.py":[1],"/root/Documents/save_me/storeManager/app/tests/test_basic.py":[2,3,4,5,6,7,8,10,13,14,35,41,48,55,65,76,98,122,141,165,201,223,224,227,238,252,262,282,302,328,340,15,16,17,19,20,23,24,25,29,30,31,32,44,46,68,69,72,73,58,59,62,63,128,129,130,131,132,133,134,135,138,139,82,83,84,85,86,87,88,89,91,92,95,96,104,105,106,107,108,109,110,111,113,114,116,118,120,147,148,149,150,151,152,153,154,155,157,158,161,162,163,172,173,174,175,176,177,178,179,181,182,186,187,191,194,195,196,198,199,206,207,208,209,210,211,212,213,215,216,217,220,36,37,38,51,52,329,330,331,332,335,336,305,306,307,308,310,311,312,314,315,316,319,320,324,325,225,266,267,268,269,270,271,272,273,275,280,286,287,288,289,290,291,292,293,295,300,228,229,230,231,234,235,255,256,257,260,244,245,246,249,250],"/root/Documents/save_me/storeManager/app/app.py":[2,3,4,5,7,8,9,10,14,15,18,19,20,23,24,25,26,27,28,30,31,35,36,39,40,41,44,45,46,47,48,49,51,52,59,60,61,62,63,64,69,70,71,72,73,74,75,81,82,84,85,86,91,92,93,94,95,96,101,102,103,104,105,111,112,113,116,117,125,127,128,129,131,132,134,135,137,138,140,141,146,150,151,155,163,171,179,187,188,190,245,250,286,287,290,301,309,326,340,341,342,368,374,394,395,396,416,426,442,455,456,457,460,461,462,463,173,174,196,197,198,199,200,203,204,205,207,208,209,211,212,213,217,218,219,220,222,223,224,226,227,228,230,231,232,234,236,237,239,240,241,243,247,157,158,291,292,293,294,295,296,297,299,302,304,307,251,254,255,256,257,258,259,260,261,262,263,264,265,266,270,272,273,274,279,282,283,181,182,183,305,327,328,331,333,336,310,311,314,317,320,321,324,315,343,344,345,346,349,350,351,354,355,357,358,361,362,363,366,370,371,397,398,399,402,403,406,407,410,411,414,417,419,423,165,166,167,376,379,380,381,382,383,384,387,390,391,420,444,446,448,451,428,430,432,434,435,439,431],"/root/Documents/save_me/storeManager/app/tests/test_basic_.py":[1,2,3,4,5,6,7,9,12,13,41,53,63,71,78,90,116,134,158,193,218,219,231,245,256,282,292,312,14,15,16,18,19,22,24,25,27,28,29,31,32,33,37,38,83,84,86,88,45,47,49,51,74,75,56,57,60,61,67,68,121,122,123,124,125,126,127,128,131,132,96,97,98,99,100,102,103,104,106,107,110,112,114,164,165,166,167,168,169,170,171,173,174,178,179,183,186,187,188,190,191,140,141,142,143,144,145,146,147,148,150,151,154,155,156,199,200,201,202,203,204,205,206,208,209,210,213,215,246,247,248,249,252,253,259,260,261,262,264,265,266,268,269,270,273,274,278,279,285,286,287,290,220,221,222,223,226,228,237,238,239,242,243,296,297,298,299,300,301,302,303,305,310,316,317,318,319,320,321,322,323,325,326]}} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 97444a4..31369dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,10 @@ aniso8601==3.0.2 +atomicwrites==1.2.1 +attrs==18.2.0 certifi==2018.10.15 chardet==3.0.4 Click==7.0 -coverage==4.0.3 +coverage==4.5.1 coveralls==1.5.1 docopt==0.6.2 Flask==1.0.2 @@ -13,6 +15,13 @@ idna==2.7 itsdangerous==0.24 Jinja2==2.10 MarkupSafe==1.0 +mock==2.0.0 +more-itertools==4.3.0 +pbr==5.0.0 +pluggy==0.8.0 +py==1.7.0 +pytest==3.9.1 +pytest-cov==2.6.0 python-coveralls==2.9.1 pytz==2018.5 PyYAML==3.13 From 8da784d62456c1cf161f099c28642e8a9cc40d76 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 18:57:30 +0300 Subject: [PATCH 10/16] Change config settings to try deploy --- Procfile | 2 +- app/__init__.py | 8 ++++++++ app/config.py | 24 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 app/config.py diff --git a/Procfile b/Procfile index 982d380..5a3a0ab 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn app:my_app +web: gunicorn - 4 app.app:my_app diff --git a/app/__init__.py b/app/__init__.py index e69de29..6967586 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -0,0 +1,8 @@ +import os +from flask import Flask + +my_app = Flask(__name__) +my_app.config.from_object(os.environ['APP_SETTINGS']) + +return my_app + diff --git a/app/config.py b/app/config.py new file mode 100644 index 0000000..c1498b1 --- /dev/null +++ b/app/config.py @@ -0,0 +1,24 @@ +import os +basedir = os.path.abspath(os.path.dirname(__file__)) + + +class Config(object): + DEBUG = False + TESTING = False + CSRF_ENABLED = True + SECRET_KEY = 'secrtet-key-secrete' + + +class ProductionConfig(Config): + DEBUG = False + + +class StagingConfig(Config): + DEVELOPMENT = True + DEBUG = True + + +class DevelopmentConfig(Config): + DEVELOPMENT = True + DEBUG = True + From 531ddaa90f40338769d1f31cb3d78deb743b9569 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 19:11:13 +0300 Subject: [PATCH 11/16] Change config settings to try deploy --- Procfile | 2 +- app/__init__.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Procfile b/Procfile index 5a3a0ab..7f4dd6d 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn - 4 app.app:my_app +web: gunicorn "app.app:my_app" diff --git a/app/__init__.py b/app/__init__.py index 6967586..647dbb9 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -2,7 +2,10 @@ from flask import Flask my_app = Flask(__name__) -my_app.config.from_object(os.environ['APP_SETTINGS']) - -return my_app +#my_app.config.from_object(os.environ['APP_SETTINGS']) +my_app_settings = os.getenv( + 'APP_SETTINGS', + 'project.config.DevConfig' +) +app.config.from_object(my_app_settings) From b912fca6970f956429c4d4a2bf3cb0655498c7a1 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 19:16:18 +0300 Subject: [PATCH 12/16] Traceback actual gunicorn error --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 7f4dd6d..be5721c 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn "app.app:my_app" +web: gunicorn app.app:my_app --preload --workers 4 From 64540e14ed853259a597c4ee0cb0a93474ead144 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 19:18:52 +0300 Subject: [PATCH 13/16] checked for missing module error --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index 647dbb9..a1659a3 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -8,4 +8,4 @@ 'APP_SETTINGS', 'project.config.DevConfig' ) -app.config.from_object(my_app_settings) +my_app.config.from_object(my_app_settings) From 32f8f9d2ac9aa6aa496e651638d67ecea6762041 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 19:22:16 +0300 Subject: [PATCH 14/16] checked missing config module --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index a1659a3..53f2d15 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -6,6 +6,6 @@ my_app_settings = os.getenv( 'APP_SETTINGS', - 'project.config.DevConfig' + 'app.config.DevelopmentConfig' ) my_app.config.from_object(my_app_settings) From 05f6bada75650731ad93b6bb01ea57f734015fd6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 19:51:22 +0300 Subject: [PATCH 15/16] heroku flat style --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aef9d29..3299d66 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # storeManager -[![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=project-app)](https://travis-ci.com/hogum/storeManager) -[![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=master)](https://travis-ci.com/hogum/storeManager) +[![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=project-app)](https://travis-ci.com/hogum/storeManager)[![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=master)](https://travis-ci.com/hogum/storeManager) [![Coverage Status](https://coveralls.io/repos/github/hogum/storeManager/badge.svg)](https://coveralls.io/github/hogum/storeManager) - +[![Heroku](http://store-man90.herokuapp.com/?app=store-man90&root=index.html)] [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/hogum/storeManager) From d6c0997b30c41c1b87d9b902d4a9aa5014063532 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 21 Oct 2018 19:56:24 +0300 Subject: [PATCH 16/16] heroku flat style --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3299d66..a4d6b08 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=project-app)](https://travis-ci.com/hogum/storeManager)[![Build Status](https://travis-ci.com/hogum/storeManager.svg?branch=master)](https://travis-ci.com/hogum/storeManager) [![Coverage Status](https://coveralls.io/repos/github/hogum/storeManager/badge.svg)](https://coveralls.io/github/hogum/storeManager) + + [![Heroku](http://store-man90.herokuapp.com/?app=store-man90&root=index.html)] [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/hogum/storeManager)