These are chat archives for django/django

9th
Jun 2016
sumit sinha
@sumitsinha91
Jun 09 2016 09:48
hello guys
i need some help
i want to use wkhtmltopdf
there i want to print multiple order number with as selection of checkbx
so anyone have any expertise on wkhtmltopdf
sumit sinha
@sumitsinha91
Jun 09 2016 10:05
hey anyone used wkhtmltopdf in your won project ...means django project
Andrew Backer
@awbacker
Jun 09 2016 10:26
We've only used reportlab but we had to fork it for our needs. not big changes
Filip Figiel
@megapctr
Jun 09 2016 11:05
@sumitsinha91 if you're not very committed to that library, I recommend trying out weasyprint. it just works and probably has bigger community
also, I didn't understand your problem
elaborate plz
this my url when i am hiting on this i got pdf
i have order number so when i an using with url and order number lik this for example- http://127.0.0.1:8000/ops/pdf/689080957885
so i got one details in pdf
i want to use like multiple oder number with differnet order number like for example- http://127.0.0.1:8000/ops/pdf/689080957885, 124578965478,365478954258,
like this ...
i am sending you view code
Filip Figiel
@megapctr
Jun 09 2016 11:19
@sumitsinha91 lol
i won't be able to open that link buddy
sumit sinha
@sumitsinha91
Jun 09 2016 11:19
class WaybillPDFView(View):
    template = 'ops/pdf.html'
    context = {'title': 'Hello World!'}

    # import pdb
    # pdb.set_trace()


    def send_order(self, wabn):
        try:
            url = "http://127.0.0.1:8000/order/" + wabn
            token = "0db44a529d7bc40920a656efde7665d4655f9296"
            response = requests.get(url=url, headers={"Authorization": "Token " + token})
            return response.json()
        except Exception as e:
            print e

    def get(self, request):
        data = self.send_order("689080957885")
        self.context = data
        response = PDFTemplateResponse(request=request,
                                       template=self.template,
                                       filename="Waybill.pdf",
                                       context=self.context,
                                       show_content_in_browser=False,
                                       )

        return response
i know that you will not able but you can userstand
AntonTokar
@AntonTokar
Jun 09 2016 11:26
hello
lego
@legobillyjoe
Jun 09 2016 11:28
Question.
Hi all! Here is my another attemt to finish official Django tutorial. There is a part where we connect the poll app to our project.
https://docs.djangoproject.com/en/1.9/intro/tutorial02/#activating-models
As for privious Django 1.8 tutorial we added only polls to INSTALLED_APPS in settings.py. Now we write something like polls.apps.PollsConfig. WTF? Why? The question is why we write this exactly? What is PollsConfig? How do I know what to write here if I connect my own app? Thanks.
Filip Figiel
@megapctr
Jun 09 2016 11:36
@legobillyjoe you don't really need that
from what I know, it's mostly for customizing the polls section in django admin
lego
@legobillyjoe
Jun 09 2016 11:45
@megapctr Thaanx (=
sumit sinha
@sumitsinha91
Jun 09 2016 11:48
hey filip
give me some idea bro
i have show you everything related to this
Zeeshan Asgar
@asgarzee
Jun 09 2016 11:49

hey guys....

How to generate zip archive from the PDFTemplateResponse object. I m using Django- wkhtml2pdf to generate pdf from html. Using this i got a response object, now i have to generate zip archive from it.
I have used zipfile module but it takes a file name to zip it.

So How to do it..

Thanks in advance.

Joseph Muli
@josephmuli
Jun 09 2016 15:39
hey guys, how do I pre-fill my forms from the database?