Passing an entire object to view context and putting in it to the html that goes to pdf, i'm trying to get an image. Thats the view :
def customer_reader_pdf_view(request,*args,**kwargs):
pk = kwargs.get('pk')
customer = get_object_or_404(Customer, pk=pk)
template_path = 'users/pdf_customer.html'
context = {'customer': customer }
...
```
But in the html wen i try to get the image passing the url :
<img src="{{ customer.logo.url }}" heigth="200px">
Traceback (most recent call last):
File "/home/marcus_andrade/Desktop/pyp/Django_PDF/venv/lib/python3.8/site-packages/xhtml2pdf/context.py", line 773, in _getFileDeprecated
nv = self.pathCallback(name, relative)
TypeError: 'str' object is not callable
Need a valid file name!
I get the url, but it broke my code ... someone could help me ?
Passing an entire object to view context and putting in it to the html that goes to pdf, i'm trying to get an image. Thats the view :
Traceback (most recent call last):
File "/home/marcus_andrade/Desktop/pyp/Django_PDF/venv/lib/python3.8/site-packages/xhtml2pdf/context.py", line 773, in _getFileDeprecated
nv = self.pathCallback(name, relative)
TypeError: 'str' object is not callable
Need a valid file name!