2018-12-30 12:20:08 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
from django.http import HttpResponse
|
|
|
|
|
from django.views.generic import View
|
2017-03-25 16:18:34 +00:00
|
|
|
from rest_framework.pagination import PageNumberPagination
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class StandardPagination(PageNumberPagination):
|
|
|
|
|
page_size = 25
|
2020-10-21 12:16:25 +02:00
|
|
|
page_size_query_param = "page_size"
|
2017-03-25 16:18:34 +00:00
|
|
|
max_page_size = 100000
|
2018-12-30 12:20:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class FaviconView(View):
|
|
|
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
|
|
|
favicon = os.path.join(
|
|
|
|
|
os.path.dirname(__file__),
|
|
|
|
|
"static",
|
|
|
|
|
"paperless",
|
|
|
|
|
"img",
|
|
|
|
|
"favicon.ico"
|
|
|
|
|
)
|
|
|
|
|
with open(favicon, "rb") as f:
|
|
|
|
|
return HttpResponse(f, content_type="image/x-icon")
|