On Dec 7, 8:45 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Sun, 2008-12-07 at 14:24 -0300, Patricio Palma wrote:
>
> > On Sun, Dec 7, 2008 at 2:12 AM, Karen Tracey <kmtra...@gmail.com>
> > wrote:
>
> > Something like View->Page Source from the browser menu?
> > (That's what Firefox calls it -- I'd guess most browsers have
> > some such way to see the raw html for a page.) Or am I
> > misunderstanding your question?
>
> > Karen
>
> > You're right, so Can I keep this raw html in a local variable?
>
> > something like this
>
> > e.g
>
> > >>> myRawPage = ViewPageSourceFromFireFoxMenu()
>
> If you want the data retrieved from the web page in Python, use
> something like the urllib or urllib2 module to retrieve it (there's
> nothing Django specific about that, it's just a standard Python module
> and is documented in the Python documentation with lots of examples
> available via Google).
>
> There are Python interfaces to Mozilla-based browsers, but they are
> fairly fiddly to use and, baesd on the questions you are asking,
> probably a bit beyond where you're at now.
>
> Regards,
> Malcolm
I found a simple way to do it, I explain+
in my system I need report to user when the Administrator makes
changes, so
I'm using e-mail to send a report.
then creating a "emailTemplate.html", I send a report using the system
"skin"
info = Mymodel.objects.all()
subject, from_email, to = 'Reporting',
'fromem...@domain.cl', 'toem...@domain.cl'
html_content = render_to_response('/templates/path/
emailTemplate.html', { 'info': info})
text_content = 'This is an important message.'
msg = EmailMultiAlternatives(subject, text_content,
from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.content_subtype = "html"
msg.send()
and the template
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/
dashboard.css{% endblock %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}dashboard{% endblock %}
{% block content %}
{% if info %}
process info
{% endif %}
{% endblock %}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---