-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathconfig.py
More file actions
executable file
·54 lines (40 loc) · 1.3 KB
/
config.py
File metadata and controls
executable file
·54 lines (40 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /usr/bin/env python3.4
# -*- coding: utf-8 -*-
# config.py - configuration for crysadm web and redis server
__author__ = 'powergx'
DEBUG_MODE = False
def crys_log(message):
"""Automatically log the current function details."""
import inspect
from datetime import datetime
func = inspect.currentframe().f_back.f_code
if DEBUG_MODE:
print("[%s] [%s:%s]: %s" % (datetime.now().strftime(
'%Y-%m-%d %H:%M:%S'), func.co_name, func.co_firstlineno, message))
class RedisConfig():
def __init__(self, host, port, db, password=None):
self.host = host
self.port = port
self.db = db
self.password = password
class Config(object):
DEBUG = False
TESTING = False
DATABASE_URI = ''
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}
SESSION_TYPE = 'memcached'
SECRET_KEY = 'sw7dWI8l-9Tw0-rcn1-vdYM-zVWoAox5q4Il'
REDIS_CONF = RedisConfig(host='127.0.0.1', port=6379, db=0)
PASSWORD_PREFIX = "4kSjyQUD-rhTQ-qPkm-OvnJ-jedEdMOiONNa"
ENCRYPT_PWD_URL = None
SERVER_IP = '0.0.0.0'
SERVER_PORT = 4000
class ProductionConfig(Config):
DEBUG = False
TESTING = False
class DevelopmentConfig(Config):
DEBUG = True
TESTING = False
class TestingConfig(Config):
DEBUG = True
TESTING = True