提交 d563dc4e authored 作者: 苏星豪's avatar 苏星豪

add: README.md新增打印sql语句配置项说明

上级 6ea7b3c8
......@@ -9,8 +9,8 @@
# requirements:
django 3.1.4
## 查询是否有未运行的migration,前面没得X的就是没运行的:
`
#### 查询是否有未运行的migration,前面没得X的就是没运行的:
```shell
PS C:\Program Files\Python36> .\python.exe E:\datacenter\manage.py showmigrations
E:\datacenter\utils\views.py:29: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
from cryptography.fernet import Fernet
......@@ -28,4 +28,25 @@ auth
[X] 0007_alter_validators_add_error_messages
[X] 0008_alter_user_username_max_length
[X] 0009_alter_user_last_name_max_length
`
\ No newline at end of file
```
#### debug打印sql语句,settings.py中加入:
```python
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
},
'loggers': {
'django.db.backends': {
'handlers': ['console'],
'propagate': True,
'level': 'DEBUG',
},
}
}
```
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论