Minstrels
Minstrels

Reputation: 53

WKHTMLtoPDF load CSS and Media files

I'm trying to use images stored in the MEDIA folder in the PDF I'm using a code:

<img src"{{MEDIA_URL}}{{booking.photo.path}}">

This loads a broken image in the generated PDF.

Additionally the bootstrap which i am attempting to load from cdn also doesn't work.

Any help would be appreciated.

Upvotes: 1

Views: 1156

Answers (1)

Minstrels
Minstrels

Reputation: 53

I seem to have figured it out...

Instead of : <img src"{{MEDIA_URL}}{{booking.photo.path}}"> When I use <img src"http://127.0.0.1:800/media/{{booking.photo.path}}">then it works!

http://127.0.0.1:8000 is my localhost address.

Upvotes: 1

Related Questions