Configuration¶
For changing your django_ocr_server behavior you can use several parameters in the settings.py of your django project.
-
django_ocr_server.default_settings.
OCR_STORE_FILES
= True¶ Store uploaded files (True) or not (False), default to True
-
django_ocr_server.default_settings.
OCR_FILE_PREVIEW
= True¶ Show file preview in admin (True) or not (False), default to True
-
django_ocr_server.default_settings.
OCR_TESSERACT_LANG
= 'rus+eng'¶ Sets priority of using languages, default to ‘rus+eng’
-
django_ocr_server.default_settings.
OCR_STORE_PDF
= True¶ Generate and store recognized searchable PDF (True) or not (False), default to True
-
django_ocr_server.default_settings.
OCR_STORE_FILES_DISABLED_LABEL
= 'store_files_disabled'¶ The text of storeing uploaded files disabled label in the admin interface
-
django_ocr_server.default_settings.
OCR_STORE_PDF_DISABLED_LABEL
= 'store_pdf_disabled'¶ The text of storeing recognized PDF disabled label in the admin interface
-
django_ocr_server.default_settings.
OCR_FILE_REMOVED_LABEL
= 'file_removed'¶ The text of the label of file removed in the admin interface
-
django_ocr_server.default_settings.
OCR_PDF_REMOVED_LABEL
= 'pdf_removed'¶ The text of the label of PDF removed in the admin interface
-
django_ocr_server.default_settings.
OCR_ALLOWED_FILE_TYPES
= ['application/pdf', 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff']¶ The types of file allowed to uploading
-
django_ocr_server.default_settings.
OCR_FILES_UPLOAD_TO
= '/home/docs/checkouts/readthedocs.org/user_builds/django-ocr-server/checkouts/latest/django_ocr_server/upload'¶ The directory for saving uploaded files
-
django_ocr_server.default_settings.
OCR_PDF_UPLOAD_TO
= '/home/docs/checkouts/readthedocs.org/user_builds/django-ocr-server/checkouts/latest/django_ocr_server/pdf'¶ The directory for storeing searchable PDFs
Time to live settings¶
-
django_ocr_server.default_settings.
OCR_FILES_TTL
= datetime.timedelta(0)¶ When current datetime will be grater then the datetime of file uploading plus this timedelta, the uploaded file will be removed. timedelta(0) means that OCR_FILES_TTL is disabled. Defaults to timedelta(0).
-
django_ocr_server.default_settings.
OCR_PDF_TTL
= datetime.timedelta(0)¶ When current datetime will be grater then the datetime of creating recognized PDF plus this timedelta, the recognized PDF will be removed. timedelta(0) means that OCR_PDF_TTL is disabled. Defaults to timedelta(0).
-
django_ocr_server.default_settings.
OCR_TTL
= datetime.timedelta(0)¶ When current datetime will be grater then the datetime of creating the model (OCRedFile) in the database plus this timedelta, the model in the database will be removed. timedelta(0) means that OCR_TTL is disabled. Defaults to timedelta(0).