一个bug
This commit is contained in:
parent
302273ad91
commit
69429a360c
|
|
@ -28,7 +28,7 @@ class RecordMixin():
|
||||||
`request.user` or `request.auth` is accessed.
|
`request.user` or `request.auth` is accessed.
|
||||||
"""
|
"""
|
||||||
if request.user and request.method == 'GET' and request.user.username != 'admin':
|
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)
|
request.method,search=request.query_params.get('search',None),query=request.query_params)
|
||||||
|
|
||||||
class QueryRecordListViewSet(ListModelMixin, GenericViewSet):
|
class QueryRecordListViewSet(ListModelMixin, GenericViewSet):
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
from .settings import *
|
from .settings import *
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
|
||||||
'NAME': 'cma',
|
|
||||||
'USER': 'postgres',
|
|
||||||
'PASSWORD': 'zctest1234',
|
|
||||||
'HOST': '47.95.0.242',
|
|
||||||
'PORT': '5432',
|
|
||||||
}
|
|
||||||
# 'default': {
|
# 'default': {
|
||||||
# 'ENGINE': 'django.db.backends.postgresql',
|
# 'ENGINE': 'django.db.backends.postgresql',
|
||||||
# 'NAME': 'cma',
|
# 'NAME': 'cma',
|
||||||
# 'USER': 'cma',
|
# 'USER': 'postgres',
|
||||||
# 'PASSWORD': 'cma123',
|
# 'PASSWORD': 'zctest1234',
|
||||||
# 'HOST': '172.16.80.102',
|
# 'HOST': '47.95.0.242',
|
||||||
# 'PORT': '5432',
|
# 'PORT': '5432',
|
||||||
# }
|
# }
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
|
'NAME': 'cma',
|
||||||
|
'USER': 'cma',
|
||||||
|
'PASSWORD': 'cma123',
|
||||||
|
'HOST': '172.16.80.102',
|
||||||
|
'PORT': '5432',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue