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*
|
||||
templates/*audit*
|
||||
codeLin*
|
||||
lib/spec_*
|
||||
|
|
|
@ -19,13 +19,18 @@ CACHE_REDIS_PORT = 6379
|
|||
CACHE_KEY_PREFIX = "CMDB-API"
|
||||
CACHE_DEFAULT_TIMEOUT = 3000
|
||||
|
||||
|
||||
# # CI cache
|
||||
REDIS_HOST = "127.0.0.1"
|
||||
REDIS_PORT = 6379
|
||||
REDIS_DB = 0
|
||||
REDIS_MAX_CONN = 30
|
||||
|
||||
|
||||
# # queue
|
||||
CELERY_RESULT_BACKEND = "redis://127.0.0.1//"
|
||||
BROKER_URL = 'redis://127.0.0.1//'
|
||||
BROKER_VHOST = '/'
|
||||
|
||||
|
||||
# # i18n
|
||||
ACCEPT_LANGUAGES = ['en', 'zh']
|
||||
BABEL_DEFAULT_LOCALE = 'zh'
|
||||
|
@ -48,12 +53,6 @@ MAIL_PASSWORD = ''
|
|||
DEFAULT_MAIL_SENDER = ''
|
||||
|
||||
|
||||
# # queue
|
||||
CELERY_RESULT_BACKEND = "redis://127.0.0.1//"
|
||||
BROKER_URL = 'redis://127.0.0.1//'
|
||||
BROKER_VHOST = '/'
|
||||
|
||||
|
||||
# # pagination
|
||||
PER_PAGE_COUNT_RANGE = (10, 25, 50, 100)
|
||||
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
|
||||
|
||||
from flask import current_app
|
||||
import settings
|
||||
|
||||
|
||||
class RedisHandler(object):
|
||||
def __init__(self):
|
||||
config = current_app.config
|
||||
try:
|
||||
pool = redis.ConnectionPool(
|
||||
max_connections=settings.REDIS_MAX_CONN,
|
||||
host=settings.REDIS_HOST,
|
||||
port=settings.REDIS_PORT,
|
||||
db=settings.REDIS_DB)
|
||||
max_connections=config.get("REDIS_MAX_CONN"),
|
||||
host=config.get("CACHE_REDIS_HOST"),
|
||||
port=config.get("CACHE_REDIS_PORT"),
|
||||
db=config.get("REDIS_DB"))
|
||||
self.r = redis.Redis(connection_pool=pool)
|
||||
except Exception as 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