Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to test django registration app process while in development server (no mail)

I am developing a django application on my MAC. The development server that comes with django is great. However, I installed the django-authopenid (combines django-registration app with openID) which follows the 3 step process: user signs up, app sends a confirmation email with link, and user clicks on link to confirm sign-up.

Since the django development server does not have a mail server, how do I test this confirmation email portion of the process? I followed an idea to print out the contents of the email to the terminal, but I can't follow the link. Any suggestions?

like image 295
rich Avatar asked Sep 17 '10 00:09

rich


1 Answers

Python has a debugging mail server available for this purpose.

Just execute this command and you'll have a mailserver running at port 1025

python -m smtpd -n -c DebuggingServer localhost:1025

After that you'll need to change your MAIL_HOST setting in Django and you can test your emails locally :)

like image 82
Wolph Avatar answered Apr 29 '23 13:04

Wolph