Django Rest api PDF,Email

Submitted 5 years ago
Ticket #34
Views 406
Language/Framework Django
Priority Low
Status Closed

I relly want to know how to send emails from django admin panel...

Like i want to send emails to employees using django admin.. 

And how to export django models data from django admin as PDF format

Like I need to export all the employee details as PDF file.. ( I know how to export as CSV file but not PDF)

Can you do a quick tutorials about these 2 sir? 

Submitted on Jul 08, 20
add a comment

1 Answer

Acknowledged. i see 2 questions you were looking for it. How to send the email from Django admin. Its straight forward. you can use EMAIL setup in your settings.py then you can use this library to handle it , msg = EmailMultiAlternatives(subject, text_content, settings.DEFAULT_FROM_EMAIL, [admin_email])

Submitted 5 years ago

Do you want to dowload the data as PDF in backend or you want to show the PDF downlopad option in UI where user can download the data as PDF?

- bhavana 5 years ago

I want to download the data as PDF in backend

- deepikasrinivasasharma 5 years ago

Did you tried reporrtab library. I think it should satisfy your requirement. May be I will try to create the script and share. Meanwhile if you search for reportlab you will get some idea as well

- bhavana 5 years ago

I tried to do.. but it's not working for backend.. I'll try again too ..

- deepikasrinivasasharma 5 years ago

did you tried with this approach https://docs.djangoproject.com/en/3.0/howto/outputting-pdf/?

- Vengat 5 years ago

I saw that file, but I don't understand that. I tried to do but I couldn't understand so i couldn't do

- deepikasrinivasasharma 5 years ago

ok share you code what you did so far?, then i can extend the code accordingly based on your requirement

- Vengat 5 years ago

As i see , you have raised the ticket as URGENT* priorty but no response from your end. So we will change the priority to LOW

- Vengat 5 years ago

Sorry sir, I don't have my laptop with me now. the code is in there

- deepikasrinivasasharma 5 years ago

can you share some example where i can refer it?

- deepikasrinivasasharma 4 years, 12 months ago


Latest Blogs