Blog Archive for April 9, 2010

Django Reset Password

April 9, 2010

The Django framework comes with support for resetting user passwords. This is implemented for the Admin app, but it is possible to re-use from your own screens.

URLs

The following four URLs are used in the password reset

(r'^accounts/password/reset/$', 'django.contrib.auth.views.password_reset', 
        {'post_reset_redirect' : '/accounts/password/reset/done/'}),
(r'^accounts/password/reset/done/$' …

HTML with Embedded Image and Plain Text Email

April 9, 2010

This code shows an example of sending an email that has a plain text version, and an embedded graphic in the HTML version.

try
{
  Properties lProperties = System.getProperties();
  lProperties.put("mail.smtp.host", lSmtpServer);

  Session lSession = Session.getDefaultInstance(lProperties, null …

Using Batik to convert SVG to JPG

April 9, 2010

You can use the Batik library to convert from an SVG source to a JPG image file.

Java Code

Here's the code used to convert to SVG file that is held in memory as part of a JDom document, into a JPG file on disk.

Element lRootElement = lDocument. …

Tags: svg jpg batik