mirror of https://github.com/veops/cmdb.git
delete settings.py
This commit is contained in:
parent
ac48e1cb19
commit
6976d183d2
|
@ -21,3 +21,4 @@ lib/special
|
||||||
lib/audit*
|
lib/audit*
|
||||||
templates/*audit*
|
templates/*audit*
|
||||||
codeLin*
|
codeLin*
|
||||||
|
lib/spec_*
|
||||||
|
|
|
@ -19,13 +19,18 @@ CACHE_REDIS_PORT = 6379
|
||||||
CACHE_KEY_PREFIX = "CMDB-API"
|
CACHE_KEY_PREFIX = "CMDB-API"
|
||||||
CACHE_DEFAULT_TIMEOUT = 3000
|
CACHE_DEFAULT_TIMEOUT = 3000
|
||||||
|
|
||||||
|
|
||||||
# # CI cache
|
# # CI cache
|
||||||
REDIS_HOST = "127.0.0.1"
|
|
||||||
REDIS_PORT = 6379
|
|
||||||
REDIS_DB = 0
|
REDIS_DB = 0
|
||||||
REDIS_MAX_CONN = 30
|
REDIS_MAX_CONN = 30
|
||||||
|
|
||||||
|
|
||||||
|
# # queue
|
||||||
|
CELERY_RESULT_BACKEND = "redis://127.0.0.1//"
|
||||||
|
BROKER_URL = 'redis://127.0.0.1//'
|
||||||
|
BROKER_VHOST = '/'
|
||||||
|
|
||||||
|
|
||||||
# # i18n
|
# # i18n
|
||||||
ACCEPT_LANGUAGES = ['en', 'zh']
|
ACCEPT_LANGUAGES = ['en', 'zh']
|
||||||
BABEL_DEFAULT_LOCALE = 'zh'
|
BABEL_DEFAULT_LOCALE = 'zh'
|
||||||
|
@ -48,12 +53,6 @@ MAIL_PASSWORD = ''
|
||||||
DEFAULT_MAIL_SENDER = ''
|
DEFAULT_MAIL_SENDER = ''
|
||||||
|
|
||||||
|
|
||||||
# # queue
|
|
||||||
CELERY_RESULT_BACKEND = "redis://127.0.0.1//"
|
|
||||||
BROKER_URL = 'redis://127.0.0.1//'
|
|
||||||
BROKER_VHOST = '/'
|
|
||||||
|
|
||||||
|
|
||||||
# # pagination
|
# # pagination
|
||||||
PER_PAGE_COUNT_RANGE = (10, 25, 50, 100)
|
PER_PAGE_COUNT_RANGE = (10, 25, 50, 100)
|
||||||
DEFAULT_PAGE_COUNT = 25
|
DEFAULT_PAGE_COUNT = 25
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# -*- coding:utf-8 -*-
|
||||||
|
|
||||||
|
__author__ = 'pycook'
|
10
lib/utils.py
10
lib/utils.py
|
@ -4,17 +4,17 @@
|
||||||
import redis
|
import redis
|
||||||
|
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
import settings
|
|
||||||
|
|
||||||
|
|
||||||
class RedisHandler(object):
|
class RedisHandler(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
config = current_app.config
|
||||||
try:
|
try:
|
||||||
pool = redis.ConnectionPool(
|
pool = redis.ConnectionPool(
|
||||||
max_connections=settings.REDIS_MAX_CONN,
|
max_connections=config.get("REDIS_MAX_CONN"),
|
||||||
host=settings.REDIS_HOST,
|
host=config.get("CACHE_REDIS_HOST"),
|
||||||
port=settings.REDIS_PORT,
|
port=config.get("CACHE_REDIS_PORT"),
|
||||||
db=settings.REDIS_DB)
|
db=config.get("REDIS_DB"))
|
||||||
self.r = redis.Redis(connection_pool=pool)
|
self.r = redis.Redis(connection_pool=pool)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print e
|
print e
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
# -*- coding:utf-8 -*-
|
|
||||||
|
|
||||||
## CI cache
|
|
||||||
REDIS_HOST = "127.0.0.1"
|
|
||||||
REDIS_PORT = 6379
|
|
||||||
REDIS_DB = 0
|
|
||||||
REDIS_MAX_CONN = 30
|
|
Loading…
Reference in New Issue