run in development

master
Castro0o 4 years ago
parent cf0ed05816
commit fc4b025d54

@ -1,10 +1,13 @@
# Run # Run
## in Development ## in Development
**only using flask; no Unicorn**
`export FLASK_APP=run.py` `export FLASK_APP=run.py`
`export FLASK_ENV=development` `export FLASK_ENV=development`
`flask run` `flask run`
**Using gunicorn:** **Using gunicorn:**
`gunicorn --env SCRIPT_NAME=/watermark -w 4 -b 127.0.0.1:5000 app:app --log-level debug` `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
gunicorn -w 4 -b :5000 app:app gunicorn -w 4 -b :5000 app:app
#

Binary file not shown.

@ -3,11 +3,10 @@ from flask import Flask
app = Flask(__name__) app = Flask(__name__)
if app.config["ENV"] == "production": if app.config["ENV"] == "production":
# app.config.from_object("config.ProductionConfig")
app.config['SERVER_NAME'] = '10.0.0.105' app.config['SERVER_NAME'] = '10.0.0.105'
# app.config['SERVER_NAME'] = 'hub.xpub.nl/watermark'
else: else:
app.config.from_object("config.DevelopmentConfig") app.config.from_object("config.DevelopmentConfig")
app.config['SERVER_NAME'] = '127.0.0.1:5000'
from app import views from app import views

@ -10,6 +10,7 @@ class ProductionConfig(Config):
class DevelopmentConfig(Config): class DevelopmentConfig(Config):
DEBUG = True DEBUG = True
SESSION_COOKIE_SECURE = False SESSION_COOKIE_SECURE = False
SERVER_NAME = '127.0.0.1' # 'hub.xpub.nl/watermark'
class TestingConfig(Config): class TestingConfig(Config):
TESTING = True TESTING = True

Loading…
Cancel
Save