run in development

master
Castro0o 5 years ago
parent cf0ed05816
commit fc4b025d54

@ -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
#

Binary file not shown.

@ -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

@ -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

Loading…
Cancel
Save