Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango question: An invoice that I want to send to an email
    primarykey
    data
    text
    <p>this is a Django related question. I have an invoice that I have created from a database which displays the information. Now I want to know is if I can send these details to an email address. I have tried looking at this page at <a href="http://docs.djangoproject.com/en/dev/topics/email/" rel="nofollow">http://docs.djangoproject.com/en/dev/topics/email/</a>, but I don't know if I am looking for that. I am assuming I need to create a form maybe as well.</p> <p><strong>Edit:</strong> I want something like this - but I want to return the whole form. Not just the subject. Check the views. Apologies for the late reply.</p> <pre><code> # urls.py urlpatterns = patterns('', (r'^index/add_invoice/$', add_invoice), (r'^index/invoice/$', invoice_info), (r'^index/invoice_details/(?P&lt;id&gt;\d+)/$', invoice_details), ) #views.py @login_required def add_invoice(request): if request.method == 'POST': form = InvoiceForm(request.POST or None) if form.is_valid(): form.save() send_mail('Subject here', 'Here is the message.', 'tom@example.com', ['paul@example.com'], fail_silently=False ) return HttpResponseRedirect('/index/invoice/') else: form = InvoiceForm() return render_to_response('add_invoice.html', {'form': form}, context_instance=RequestContext(request)) #add_invoice.html {% extends "base.html" %} {% block content %} &lt;font face="verdana,news gothic,arial,heltevica,serif"&gt; &lt;h3&gt; Add Invoice&lt;/h3&gt; &lt;font face="verdana,news gothic,arial,heltevica,serif"&gt; &lt;form method= "POST" action=""&gt; &lt;div id="form"&gt; &lt;table&gt; {{form.as_table}} &lt;/table&gt; &lt;div align="center" STYLE=" margin-right:270px"&gt; &lt;input type="submit" value="Submit" STYLE="background-color:#E8E8E8; color:#181818 "/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; {% endblock %} </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload