{ "info": { "author": "Claudiu Topriceanu", "author_email": "ctopriceanu@example.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# django-lightpdf\n\n[![Build Status](https://travis-ci.org/claudiutopriceanu/django-lightpdf.svg?branch=master)](https://travis-ci.org/claudiutopriceanu/django-lightpdf)\n\n\nInstallation\n------------\n\n``django-lightpdf`` depends on pdfkit and wkthmltopdf (v0.12.2.1 recommended).\n\n sudo apt-get update\n sudo apt-get install -y xorg xfonts-75dpi\n wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-wheezy-amd64.deb\n sudo dpkg -i wkhtmltox-0.12.2.1_linux-wheezy-amd64.deb\n\n pip install django-lightpdf\n\n\nConfiguration\n-------------\n\nWe need to hook ``django-lightpdf`` into our project.\n\n1. Put ``lightpdf`` into your ``INSTALLED_APPS`` in settings module::\n\n ``` \n INSTALLED_APPS = (\n ...\n 'lightpdf',\n )\n ```\n\n2. To control logging behaviour, add a ``LIGHTPDF_LOGGING_CONFIG`` dictionary to your settings file following ``logging.config.dictConfig`` schema.\n\n3. Put a ``lightpdf`` formatter into your LOGGING['formatters'] or the default value will be used.\n\n ```\n DEFAULT_LOGGING_FORMATTER = {\n 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'\n }\n ```\n\n4. Put a ``lightpdf`` handler into your LOGGING['handlers'] or the default value will be used.\n\n ```\n DEFAULT_LOGGING_HANDLER = {\n 'level': 'INFO',\n 'class': 'logging.StreamHandler',\n 'formatter': 'lightpdf'\n }\n ```\n\n5. Put a ``lightpdf`` handler into your LOGGING['loggers'] or the default value will be used.\n\n ```\n DEFAULT_LOGGER = {\n 'handlers': ['lightpdf'],\n 'level': 'INFO',\n }\n ```\n\n6. Add a ``LIGHTPDF_PDFKIT_OPTIONS`` dictionary that will be used as kwargs for ``pdfkit.from_string()`` or the default values will be used.\n\n ```\n PDFKIT_OPTIONS = {\n 'page-size': 'Letter',\n 'margin-top': '1.2in',\n 'margin-right': '0.75in',\n 'margin-bottom': '1.2in',\n 'margin-left': '0.75in',\n 'encoding': \"UTF-8\",\n 'no-outline': None,\n 'quiet': '',\n }\n ```\n\n\nUsage\n-----\n ```\n from django.views.generic import TemplateView\n from lightpdf.mixins import PdfGeneratorMixin\n\n\n class PdfView(PdfGeneratorMixin, TemplateView):\n template_name = 'blah.html'\n pdf_name = 'superblah'\n\n def get(self, request, *args, **kwargs):\n return self.render_to_pdf_response()\n ```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/claudiutopriceanu/django-lightpdf", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-lightpdf", "package_url": "https://pypi.org/project/django-lightpdf/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-lightpdf/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/claudiutopriceanu/django-lightpdf" }, "release_url": "https://pypi.org/project/django-lightpdf/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "A simple Django app to help generate pdfs", "version": "0.1.1" }, "last_serial": 1959945, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "17b92f29f13b1e4e7384e010ad0dc0f0", "sha256": "6a0d69a1fe4b77cc09c2e36110eaa514037b3cc65d0b8e148bff67599846cb7e" }, "downloads": -1, "filename": "django-lightpdf-0.1.0.tar.gz", "has_sig": false, "md5_digest": "17b92f29f13b1e4e7384e010ad0dc0f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3575, "upload_time": "2016-02-14T14:23:49", "url": "https://files.pythonhosted.org/packages/39/cc/2258322b1357586a19b33258b347aa33768a8b9ea274a937d9b16b333823/django-lightpdf-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "769c5ad45c4cfc37412816509457fb61", "sha256": "f288709e0d0a9d9f990e173bdbeb2505b344d24fb75b6778c635a62f939011c3" }, "downloads": -1, "filename": "django-lightpdf-0.1.1.tar.gz", "has_sig": false, "md5_digest": "769c5ad45c4cfc37412816509457fb61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3600, "upload_time": "2016-02-16T18:55:37", "url": "https://files.pythonhosted.org/packages/73/1b/aa173eb196c836842f3ffa8d6a098f69782e0ca5cbdd618dc59b44896e08/django-lightpdf-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "769c5ad45c4cfc37412816509457fb61", "sha256": "f288709e0d0a9d9f990e173bdbeb2505b344d24fb75b6778c635a62f939011c3" }, "downloads": -1, "filename": "django-lightpdf-0.1.1.tar.gz", "has_sig": false, "md5_digest": "769c5ad45c4cfc37412816509457fb61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3600, "upload_time": "2016-02-16T18:55:37", "url": "https://files.pythonhosted.org/packages/73/1b/aa173eb196c836842f3ffa8d6a098f69782e0ca5cbdd618dc59b44896e08/django-lightpdf-0.1.1.tar.gz" } ] }