一个bug

This commit is contained in:
caoqianming 2021-07-29 15:35:50 +08:00
parent 302273ad91
commit 69429a360c
2 changed files with 12 additions and 12 deletions

View File

@ -28,7 +28,7 @@ class RecordMixin():
`request.user` or `request.auth` is accessed.
"""
if request.user and request.method == 'GET' and request.user.username != 'admin':
QueryRecord.objects.create(user=user,path=request.path,ip=request.META.get('HTTP_X_FORWARDED_FOR'),method=\
QueryRecord.objects.create(user=request.user,path=request.path,ip=request.META.get('HTTP_X_FORWARDED_FOR'),method=\
request.method,search=request.query_params.get('search',None),query=request.query_params)
class QueryRecordListViewSet(ListModelMixin, GenericViewSet):

View File

@ -1,20 +1,20 @@
from .settings import *
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'cma',
'USER': 'postgres',
'PASSWORD': 'zctest1234',
'HOST': '47.95.0.242',
'PORT': '5432',
}
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'cma',
# 'USER': 'cma',
# 'PASSWORD': 'cma123',
# 'HOST': '172.16.80.102',
# 'USER': 'postgres',
# 'PASSWORD': 'zctest1234',
# 'HOST': '47.95.0.242',
# 'PORT': '5432',
# }
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'cma',
'USER': 'cma',
'PASSWORD': 'cma123',
'HOST': '172.16.80.102',
'PORT': '5432',
}
}