{"action":"opened","issue":{"url":"https://api.github.com/repos/incuna/django-wkhtmltopdf/issues/137","repository_url":"https://api.github.com/repos/incuna/django-wkhtmltopdf","labels_url":"https://api.github.com/repos/incuna/django-wkhtmltopdf/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/incuna/django-wkhtmltopdf/issues/137/comments","events_url":"https://api.github.com/repos/incuna/django-wkhtmltopdf/issues/137/events","html_url":"https://github.com/incuna/django-wkhtmltopdf/issues/137","id":218274001,"number":137,"title":"extending base.html - styles not applied to pdf","user":{"login":"davideghz","id":6973157,"avatar_url":"https://avatars0.githubusercontent.com/u/6973157?v=3","gravatar_id":"","url":"https://api.github.com/users/davideghz","html_url":"https://github.com/davideghz","followers_url":"https://api.github.com/users/davideghz/followers","following_url":"https://api.github.com/users/davideghz/following{/other_user}","gists_url":"https://api.github.com/users/davideghz/gists{/gist_id}","starred_url":"https://api.github.com/users/davideghz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideghz/subscriptions","organizations_url":"https://api.github.com/users/davideghz/orgs","repos_url":"https://api.github.com/users/davideghz/repos","events_url":"https://api.github.com/users/davideghz/events{/privacy}","received_events_url":"https://api.github.com/users/davideghz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-30T17:42:55Z","updated_at":"2017-03-30T17:42:55Z","closed_at":null,"body":"Hi, I'm trying the following w/o any luck:\r\n\r\n**urls.py**\r\n```\r\nurlpatterns = [\r\n  ...\r\n  url(r'^pdf/$', PDFTemplateView.as_view(template_name='my_template.html',\r\n                                             filename='my_pdf.pdf'), name='pdf'),\r\n]\r\n```\r\n\r\n**my_template.html**\r\n```\r\n{% extends \"base.html\" %}\r\n{% block content %}\r\n<h1 class=\"test-pdf\">lorem ipsum</h1>\r\n{% endblock %}\r\n```\r\n\r\n**base.html**\r\n```\r\n{% load static %}\r\n<!doctype html>\r\n<html lang=\"it\">\r\n<head>\r\n  <meta charset=\"utf-8\">\r\n  <meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\">\r\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n\r\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css\">\r\n\r\n  <link href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" rel=\"stylesheet\">\r\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"{% static 'prj_name/custom.css' %}\" />\r\n</head>\r\n<body>\r\n<!--[if lt IE 8]>\r\n            <p class=\"browserupgrade\">\r\n            You are using an <strong>outdated</strong> browser. Please <a href=\"http://browsehappy.com/\">upgrade your browser</a> to improve your experience.\r\n            </p>\r\n        <![endif]-->\r\n\r\n{% block content %} {% endblock %}\r\n\r\n<script\r\n  src=\"https://code.jquery.com/jquery-3.1.1.min.js\"\r\n  integrity=\"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=\"\r\n  crossorigin=\"anonymous\"></script>\r\n<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>\r\n\r\n<script src=\"{% static 'smart-selects/admin/js/chainedfk.js' %}\"></script>\r\n<script src=\"{% static 'mrp/custom.js' %}\"></script>\r\n\r\n</body>\r\n</html>\r\n```\r\n\r\nIf I browse http://localhost:8000/pdf/?as=html I can see all the stylings, but I lose them in the pdf (here attached as example). What am I doing wrong? Thanks!\r\n\r\n[my_pdf (1).pdf](https://github.com/incuna/django-wkhtmltopdf/files/883303/my_pdf.1.pdf)\r\n"}}
{"actor":{"display_login":"davideghz"}}