我有一个使用Django rest框架的应用程序。当我使用Django的Web开发服务器时,我最多可以获取1000条记录,但是当我将应用程序迁移到Apache时,我只能访问100条记录的范围(使用分页),否则,请求将被阻止并且永远不会结束。>
class NetworkDevicesList(generics.ListCreateAPIView):
queryset = devicesModel.objects.all().order_by('-end_of_life')
serializer_class = devicesSerializer
http_method_names = ['get']
filter_backends = (DjangoFilterBackend,)
filter_fields = ('device_id',)
开发服务器中的Settings.py
REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 500
}
Settings.py in apache server
REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 100
}
Apache
Alias /static/ /dashboard/equipment/project/static/
<Directory /dashboard/equipment/project/static>
Require all granted
</Directory>
<Directory /dashboard/equipment/project/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess myproject processes=4 threads=2 python-home=/path_to/env/ python-path=/path_to/python_path
WSGIProcessGroup myproject
WSGIScriptAlias / /dashboard/equipment/project/dashboard_project/wsgi.py
apache服务器日志不会显示任何错误,只会崩溃,因为请求永远不会结束。