Skip to content

Latest commit

 

History

History
74 lines (66 loc) · 1.85 KB

README.ZH_CN.md

File metadata and controls

74 lines (66 loc) · 1.85 KB

DongTai-core

django-project DongTai-project DongTai-core

项目介绍

提供DongTai项目依赖的Django Model对象,DongTai项目的Django API抽象类、漏洞检测引擎、常量、文档等内容。

快速开始

  1. 安装dongtai依赖包

项目打包

$ python setup.py sdist

安装dongtai包

$ pip install dist/dongtai-0.1.0.tar.gz
  1. 快速开始

settings.py:

INSTALLED_APPS = [
    ...
    'dongtai',
    ...
]
  1. 打开日志 在settings.py中,增加dongtai-core的日志loggers及handlers:
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '{levelname} {asctime} [{module}.{funcName}:{lineno}] {message}',
            'style': '{',
        },
        'simple': {
            'format': '{levelname} {message}',
            'style': '{',
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose'
        },
        'dongtai.core': {
            'class': 'logging.handlers.RotatingFileHandler',
            'filename': 'logs/core.log',
            'backupCount': 5,
            'maxBytes': 1024 * 1024 * 10,
            'formatter': 'verbose'
        },
    },
    'loggers': 
        ...
        'dongtai-core': {
            'handlers': ['console', 'dongtai.core'],
            'propagate': True,
            'level': 'INFO',
        },
        ...
    }
}