Browse Source

Fix 404 errors in pdf generation on OpenShift

pull/172/head
Michael Olund 5 years ago
parent
commit
a5435dea46
3 changed files with 4 additions and 3 deletions
  1. +1
    -1
      edivorce/apps/core/templates/pdf/images_to_pdf.html
  2. +1
    -0
      edivorce/apps/core/views/pdf.py
  3. +2
    -2
      edivorce/settings/openshift.py

+ 1
- 1
edivorce/apps/core/templates/pdf/images_to_pdf.html View File

@ -29,7 +29,7 @@
<body>
<div class="print-wrapper">
{% for image in images %}
<img src="{{ css_root }}/api/documents/{{ image.file }}/{{ image.rotation }}/" style="{{ image|css_rotate }}">
<img src="{{ image_root }}/api/documents/{{ image.file }}/{{ image.rotation }}/" style="{{ image|css_rotate }}">
{% if not forloop.last %}
<p style="page-break-before: always" ></p>
{% endif %}


+ 1
- 0
edivorce/apps/core/views/pdf.py View File

@ -122,6 +122,7 @@ def images_to_pdf(request, doc_type, party_code):
return response
return __render_form(request, form_name, {
'image_root': settings.WEASYPRINT_IMAGE_LOOPBACK,
'css_root': settings.WEASYPRINT_CSS_LOOPBACK,
'images': documents,
'form': form_name


+ 2
- 2
edivorce/settings/openshift.py View File

@ -88,8 +88,8 @@ STATIC_URL = PROXY_URL_PREFIX + '/static/'
# Internal Urls (within the OpenShift project)
WEASYPRINT_URL = 'http://weasyprint:5001'
WEASYPRINT_CSS_LOOPBACK = 'http://edivorce-django:8080'
WEASYPRINT_CSS_LOOPBACK += PROXY_URL_PREFIX
WEASYPRINT_IMAGE_LOOPBACK = 'http://edivorce-django:8080'
WEASYPRINT_CSS_LOOPBACK = WEASYPRINT_IMAGE_LOOPBACK + PROXY_URL_PREFIX
# Basic authentication settings (meant for dev/test environments)
BASICAUTH_ENABLED = os.getenv('BASICAUTH_ENABLED', '').lower() == 'true'


Loading…
Cancel
Save