simplepro 依赖 simpleui、django-export-import、以及django
- 安装simplepro
pip install simplepro
- INSTALL_APPS中配置
按以下顺序加入到INSTALL_APPS数组的顶部
INSTALLED_APPS = [
'simplepro',
'simpleui',
'import_export',
......
]
- 配置中间件
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 加入simplepro的中间件
'simplepro.middlewares.SimpleMiddleware'
]
- 如果在开启DEBUG模式后,启动即可运行。
- 如果关闭后,需要克隆静态文件,步骤与simpleui一致。文档地址