linkovi za dev server i requirements
This commit is contained in:
@@ -11,6 +11,8 @@ matplotlib.use('Agg')
|
||||
import matplotlib.pyplot as plt
|
||||
from django.contrib.staticfiles.finders import find
|
||||
import matplotlib.image as mpimg
|
||||
site_domain = settings.SITE_DOMAIN
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -211,7 +213,7 @@ def get_controls_for_risk(risk, organization):
|
||||
|
||||
|
||||
def generate_pdf(document):
|
||||
document_link = f"http://127.0.0.1:8000/document/{document.id}/"
|
||||
document_link = f"{site_domain}/document/{document.id}/"
|
||||
pdf_content = HTML(url=document_link).write_pdf()
|
||||
|
||||
response = HttpResponse(pdf_content, content_type='application/pdf')
|
||||
@@ -219,7 +221,7 @@ def generate_pdf(document):
|
||||
return response
|
||||
|
||||
def generate_first_page_image(document):
|
||||
document_link = f"http://127.0.0.1:8000/document/{document.id}/"
|
||||
document_link = f"{site_domain}/document/{document.id}/"
|
||||
|
||||
pdf_bytes = HTML(url=document_link).write_pdf()
|
||||
|
||||
|
||||
@@ -15,5 +15,6 @@ PyYAML==6.0.2
|
||||
celery==5.4.0
|
||||
django-celery-results==2.5.1
|
||||
redis==5.2.1
|
||||
|
||||
weasyprint==65.1
|
||||
matplotlib==3.10.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user