# Path: library/config/database.py

# 
# Path: library/utils/time_conv.py
# def timestamp2datetime(stamp=0 , fmt='%Y-%m-%d %H:%M:%S'):
#     '''
#     将时间戳转化指定格式的时间
#     :parm :
#         stamp：时间戳，如果没有指定表示当前时间，如果不是数字型，返回错误
#         smt：转化时间格式
#     :return :
#         转化后的时间
#     '''
# 
#     try :
#         stamp = float(stamp)
#     except :
#         return False
# 
#     if int(stamp) == 0 :
#         stamp = time.time()
# 
#     try :
#         strptm = time.localtime(stamp)
#     except :
#         return False
# 
#     return time.strftime(fmt , strptm)


import os
from library.config.database import redis_config
from library.utils.time_conv import timestamp2datetime

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static/"),
]

MEDIA_ROOT = os.path.join(BASE_DIR, "file/")

# 媒体文件的相对路径：
MEDIA_URL = '/file/' 

# 设置静态文件路径
STATIC_PATH = os.path.join(BASE_DIR, "file/")

'''
sess_redis_conf = redis_config['default']
SESSION_COOKIE_AGE = 60 * 60 * 4
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
SESSION_ENGINE = 'redis_sessions.session'
SESSION_REDIS_HOST = sess_redis_conf['host']
SESSION_REDIS_PORT = sess_redis_conf['port']
SESSION_REDIS_DB = sess_redis_conf['db']
SESSION_REDIS_PASSWORD = sess_redis_conf['pwd']
SESSION_REDIS_PREFIX = 'lykchat:session'
'''


# Path: library/config/database.py

# 
# Path: library/utils/time_conv.py
# def timestamp2datetime(stamp=0 , fmt='%Y-%m-%d %H:%M:%S'):
#     '''
#     将时间戳转化指定格式的时间
#     :parm :
#         stamp：时间戳，如果没有指定表示当前时间，如果不是数字型，返回错误
#         smt：转化时间格式
#     :return :
#         转化后的时间
#     '''
# 
#     try :
#         stamp = float(stamp)
#     except :
#         return False
# 
#     if int(stamp) == 0 :
#         stamp = time.time()
# 
#     try :
#         strptm = time.localtime(stamp)
#     except :
#         return False
# 
#     return time.strftime(fmt , strptm)


# Path: lykchat/settings.py
import os
from library.config.database import redis_config
from library.utils.time_conv import timestamp2datetime


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static/"),
]

MEDIA_ROOT = os.path.join(BASE_DIR, "file/")

# 媒体文件的相对路径：
MEDIA_URL = '/file/' 

# 设置静态文件路径
STATIC_PATH = os.path.join(BASE_DIR, "file/")

'''
sess_redis_conf = redis_config['default']
SESSION_COOKIE_AGE = 60 * 60 * 4
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
SESSION_ENGINE = 'redis_sessions.session'
SESSION_REDIS_HOST = sess_redis_conf['host']
SESSION_REDIS_PORT = sess_redis_conf['port']
SESSION_REDIS_DB = sess_redis_conf['db']
SESSION_REDIS_PASSWORD = sess_redis_conf['pwd']
SESSION_REDIS_PREFIX = 'lykchat:session'
'''


sess_redis_conf = redis_config['default']