mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	| @@ -7,7 +7,7 @@ | ||||
| <head> | ||||
|   <meta charset="utf-8"> | ||||
|   <title>Paperless-ng</title> | ||||
|   <base href="/"> | ||||
|   <base href="{% url 'base' %}"> | ||||
|   <meta name="viewport" content="width=device-width, initial-scale=1"> | ||||
| 	<meta name="username" content="{{username}}"> | ||||
| 	<meta name="full_name" content="{{full_name}}"> | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -142,11 +142,14 @@ MIDDLEWARE = [ | ||||
| ROOT_URLCONF = 'paperless.urls' | ||||
|  | ||||
| FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME") | ||||
| BASE_URL = (FORCE_SCRIPT_NAME or "") + "/" | ||||
| LOGIN_URL = BASE_URL + "accounts/login/" | ||||
|  | ||||
| WSGI_APPLICATION = 'paperless.wsgi.application' | ||||
| ASGI_APPLICATION = "paperless.asgi.application" | ||||
|  | ||||
| STATIC_URL = os.getenv("PAPERLESS_STATIC_URL", "/static/") | ||||
| STATIC_URL = os.getenv("PAPERLESS_STATIC_URL", BASE_URL + "static/") | ||||
| WHITENOISE_STATIC_PREFIX = "/static/" | ||||
|  | ||||
| # TODO: what is this used for? | ||||
| TEMPLATES = [ | ||||
|   | ||||
| @@ -9,6 +9,8 @@ from rest_framework.routers import DefaultRouter | ||||
|  | ||||
| from django.utils.translation import gettext_lazy as _ | ||||
|  | ||||
| from django.conf import settings | ||||
|  | ||||
| from paperless.consumers import StatusConsumer | ||||
| from documents.views import ( | ||||
|     CorrespondentViewSet, | ||||
| @@ -73,31 +75,36 @@ urlpatterns = [ | ||||
|     re_path(r"^fetch/", include([ | ||||
|         re_path( | ||||
|             r"^doc/(?P<pk>\d+)$", | ||||
|             RedirectView.as_view(url='/api/documents/%(pk)s/download/'), | ||||
|             RedirectView.as_view(url=settings.BASE_URL + | ||||
|                                  'api/documents/%(pk)s/download/'), | ||||
|         ), | ||||
|         re_path( | ||||
|             r"^thumb/(?P<pk>\d+)$", | ||||
|             RedirectView.as_view(url='/api/documents/%(pk)s/thumb/'), | ||||
|             RedirectView.as_view(url=settings.BASE_URL + | ||||
|                                  'api/documents/%(pk)s/thumb/'), | ||||
|         ), | ||||
|         re_path( | ||||
|             r"^preview/(?P<pk>\d+)$", | ||||
|             RedirectView.as_view(url='/api/documents/%(pk)s/preview/'), | ||||
|             RedirectView.as_view(url=settings.BASE_URL + | ||||
|                                  'api/documents/%(pk)s/preview/'), | ||||
|         ), | ||||
|     ])), | ||||
|  | ||||
|     re_path(r"^push$", csrf_exempt( | ||||
|         RedirectView.as_view(url='/api/documents/post_document/'))), | ||||
|         RedirectView.as_view(url=settings.BASE_URL + | ||||
|                              'api/documents/post_document/'))), | ||||
|  | ||||
|     # Frontend assets TODO: this is pretty bad, but it works. | ||||
|     path('assets/<path:path>', | ||||
|          RedirectView.as_view(url='/static/frontend/en-US/assets/%(path)s')), | ||||
|          RedirectView.as_view(url=settings.STATIC_URL + | ||||
|                               'frontend/en-US/assets/%(path)s')), | ||||
|     # TODO: with localization, this is even worse! :/ | ||||
|  | ||||
|     # login, logout | ||||
|     path('accounts/', include('django.contrib.auth.urls')), | ||||
|  | ||||
|     # Root of the Frontent | ||||
|     re_path(r".*", login_required(IndexView.as_view())), | ||||
|     re_path(r".*", login_required(IndexView.as_view()), name='base'), | ||||
| ] | ||||
|  | ||||
|  | ||||
|   | ||||
							
								
								
									
										11
									
								
								src/paperless/workers.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/paperless/workers.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| import os | ||||
| from uvicorn.workers import UvicornWorker | ||||
| from django.conf import settings | ||||
|  | ||||
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "paperless.settings") | ||||
|  | ||||
|  | ||||
| class ConfigurableWorker(UvicornWorker): | ||||
|     CONFIG_KWARGS = { | ||||
|         "root_path": settings.FORCE_SCRIPT_NAME or "", | ||||
|     } | ||||
		Reference in New Issue
	
	Block a user
	 Jonas Winkler
					Jonas Winkler