mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	added options to change database backend
This commit is contained in:
		
							
								
								
									
										10
									
								
								paperless.conf.example
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										10
									
								
								paperless.conf.example
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @@ -3,6 +3,16 @@ | ||||
| # As this file contains passwords it should only be readable by the user | ||||
| # running paperless. | ||||
|  | ||||
| ############################################################################### | ||||
| ####                        Database Settings                              #### | ||||
| ############################################################################### | ||||
|  | ||||
| # By default, sqlite is used as the database backend. This can be changed here. | ||||
| #PAPERLESS_DBENGINE="django.db.backends.postgresql_psycopg2" | ||||
| #PAPERLESS_DBNAME="paperless" | ||||
| #PAPERLESS_DBUSER="paperless" | ||||
| #PAPERLESS_DBPASS="paperless" | ||||
|  | ||||
|  | ||||
| ############################################################################### | ||||
| ####                         Paths & Folders                               #### | ||||
|   | ||||
							
								
								
									
										4
									
								
								src/documents/checks.py
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										4
									
								
								src/documents/checks.py
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @@ -2,7 +2,7 @@ import textwrap | ||||
|  | ||||
| from django.conf import settings | ||||
| from django.core.checks import Error, register | ||||
| from django.db.utils import OperationalError | ||||
| from django.db.utils import OperationalError, ProgrammingError | ||||
|  | ||||
|  | ||||
| @register() | ||||
| @@ -14,7 +14,7 @@ def changed_password_check(app_configs, **kwargs): | ||||
|     try: | ||||
|         encrypted_doc = Document.objects.filter( | ||||
|             storage_type=Document.STORAGE_TYPE_GPG).first() | ||||
|     except OperationalError: | ||||
|     except (OperationalError, ProgrammingError): | ||||
|         return []  # No documents table yet | ||||
|  | ||||
|     if encrypted_doc: | ||||
|   | ||||
| @@ -133,9 +133,9 @@ DATABASES = { | ||||
|     } | ||||
| } | ||||
|  | ||||
| if os.getenv("PAPERLESS_DBUSER") and os.getenv("PAPERLESS_DBPASS"): | ||||
| if os.getenv("PAPERLESS_DBENGINE"): | ||||
|     DATABASES["default"] = { | ||||
|         "ENGINE": "django.db.backends.postgresql_psycopg2", | ||||
|         "ENGINE": os.getenv("PAPERLESS_DBENGINE"), | ||||
|         "NAME": os.getenv("PAPERLESS_DBNAME", "paperless"), | ||||
|         "USER": os.getenv("PAPERLESS_DBUSER"), | ||||
|         "PASSWORD": os.getenv("PAPERLESS_DBPASS") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonas Winkler
					Jonas Winkler