From e1e1b1d9bdb5f37dbfb4fdbe12c4e51b02bc8e43 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Mon, 14 Dec 2015 16:38:47 +0700 Subject: [PATCH] Read app port from config.py --- README.md | 2 +- config_template.py | 1 + run.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 59bf6d8..672b042 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ MariaDB [(none)]> GRANT ALL PRIVIELGES ON powerdnsadmin.* TO powerdnsadmin@'%' I ### PowerDNS-Admin -In this installation guide, I am using CentOS 7 and run my pythong stuffs with *virtualenv*. If you don't have it, let install: +In this installation guide, I am using CentOS 7 and run my python stuffs with *virtualenv*. If you don't have it, let install: ``` $ sudo yum install python-pip $ sudo pip install virtualenv diff --git a/config_template.py b/config_template.py index 927e34c..c6dbbf9 100644 --- a/config_template.py +++ b/config_template.py @@ -4,6 +4,7 @@ basedir = os.path.abspath(os.path.dirname(__file__)) # BASIC APP CONFIG WTF_CSRF_ENABLED = True SECRET_KEY = 'We are the world' +PORT = 9393 # LOG CONFIG LOG_LEVEL = 'DEBUG' diff --git a/run.py b/run.py index 8ac179a..de49011 100755 --- a/run.py +++ b/run.py @@ -1,5 +1,6 @@ #!flask/bin/python from app import app +from config import PORT if __name__ == '__main__': - app.run(debug = True, port=9191) \ No newline at end of file + app.run(debug = True, port=PORT)