diff --git a/README.md b/README.md index cee1a50..8db897b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # Run ## in Development +**only using flask; no Unicorn** + `export FLASK_APP=run.py` `export FLASK_ENV=development` `flask run` + **Using gunicorn:** `gunicorn --env SCRIPT_NAME=/watermark -w 4 -b 127.0.0.1:5000 app:app --log-level debug` @@ -88,3 +91,5 @@ But in the long run logging should be disabled * gunicorn -w 4 -b :5000 app:app gunicorn -w 4 -b :5000 app:app + +# \ No newline at end of file diff --git a/__pycache__/wsgi.cpython-37.pyc b/__pycache__/wsgi.cpython-37.pyc deleted file mode 100644 index 2cc299b..0000000 Binary files a/__pycache__/wsgi.cpython-37.pyc and /dev/null differ diff --git a/app/__init__.py b/app/__init__.py index f816b65..fdb2a36 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -3,11 +3,10 @@ from flask import Flask app = Flask(__name__) if app.config["ENV"] == "production": - # app.config.from_object("config.ProductionConfig") app.config['SERVER_NAME'] = '10.0.0.105' - # app.config['SERVER_NAME'] = 'hub.xpub.nl/watermark' else: app.config.from_object("config.DevelopmentConfig") + app.config['SERVER_NAME'] = '127.0.0.1:5000' from app import views diff --git a/config.py b/config.py index 01addde..124f45f 100644 --- a/config.py +++ b/config.py @@ -1,5 +1,5 @@ class Config(object): - SERVER_NAME = '10.0.0.105' # 'hub.xpub.nl/watermark' + SERVER_NAME = '10.0.0.105' # 'hub.xpub.nl/watermark' DEBUG = True TESTING = False SESSION_COOKIE_SECURE = True @@ -10,6 +10,7 @@ class ProductionConfig(Config): class DevelopmentConfig(Config): DEBUG = True SESSION_COOKIE_SECURE = False + SERVER_NAME = '127.0.0.1' # 'hub.xpub.nl/watermark' class TestingConfig(Config): TESTING = True