Bladeren bron

compatible with new version flask

laiwei 5 jaren geleden
bovenliggende
commit
d5073e7683
7 gewijzigde bestanden met toevoegingen van 11 en 8 verwijderingen
  1. 5 2
      README.md
  2. 1 1
      rrd/__init__.py
  3. 1 1
      rrd/config.py
  4. 1 1
      rrd/view/auth/auth.py
  5. 1 1
      rrd/view/dashboard/screen.py
  6. 1 1
      rrd/view/portal/cluster.py
  7. 1 1
      wsgi.py

+ 5 - 2
README.md

@@ -9,7 +9,7 @@ dashboard is the Open-Falcon unified default forntend component, including:
 - combine the multiple alerting.
 - user management, such as login, logout, register, ldap_login, etc.
 
-Open-Falcon homepage:[http://open-falcon.com](http://open-falcon.com)
+Open-Falcon homepage:[http://open-falcon.org](http://open-falcon.org)
 
 ## Demo site
 - [dashboard demo](http://116.85.44.234:8081/), user:`test`, password:`test123`
@@ -103,7 +103,10 @@ The open-falcon modules' configuration files is `path/to/open-falcon-binaries/<m
 
 ## Start in debug mode
 
-    $ ./env/bin/python wsgi.py
+    $ source ./env/bin/python wsgi.py
+    $ export FLASK_ENV=development
+    $ flask run --host=0.0.0.0 --port=8081
+
 
     open http://127.0.0.1:8081 in your browser.
 

+ 1 - 1
rrd/__init__.py

@@ -17,7 +17,7 @@
 import os
 import traceback
 from flask import Flask, request
-from flask.ext.babel import Babel, gettext
+from flask_babel import Babel, gettext
 from rrd import config
 
 #-- create app --

+ 1 - 1
rrd/config.py

@@ -22,7 +22,7 @@ PERMANENT_SESSION_LIFETIME = os.environ.get("PERMANENT_SESSION_LIFETIME",3600 *
 SITE_COOKIE = os.environ.get("SITE_COOKIE","open-falcon-ck")
 
 # Falcon+ API
-API_ADDR = os.environ.get("API_ADDR","http://127.0.0.1:8080/api/v1")
+API_ADDR = os.environ.get("API_ADDR","http://127.0.0.1:18080/api/v1")
 API_USER = os.environ.get("API_USER","admin")
 API_PASS = os.environ.get("API_PASS","password")
 

+ 1 - 1
rrd/view/auth/auth.py

@@ -15,7 +15,7 @@
 
 
 from flask import request, g, abort, render_template, redirect
-from flask.ext.babel import refresh
+from flask_babel import refresh
 import requests
 import json
 import string

+ 1 - 1
rrd/view/dashboard/screen.py

@@ -18,7 +18,7 @@ import json
 import copy
 import json
 from flask import render_template, abort, request, url_for, redirect, g
-from flask.ext.babel import gettext
+from flask_babel import gettext
 import time
 import datetime
 

+ 1 - 1
rrd/view/portal/cluster.py

@@ -16,7 +16,7 @@
 
 __author__ = 'Ulric Qin'
 from flask import jsonify, render_template, request, g
-from flask.ext.babel import gettext
+from flask_babel import gettext
 from rrd import app
 from rrd.model.portal.host_group import HostGroup
 from rrd.model.portal.cluster import Cluster

+ 1 - 1
wsgi.py

@@ -28,4 +28,4 @@ sys.path.insert(0, base_dir)
 from rrd import app
 
 if __name__ == "__main__":
-    app.run(host="0.0.0.0", port=8081, debug=True)
+    app.run(host="0.0.0.0", port=8081, debug=False)