I added a comment on the bug - in summary, why does this need to be
part of Django at all? I use fakemail [1], and it already does
almost everything you suggested. The only thing it doesn't do is
automatically override the settings, but every (sensible) user will
be using different settings for their dev box (for their database at
the very least), so I don't think we need to be that bothered about
users who haven't set up a settings file for their dev box.
I'm -1 on adding much functionality here unless there is some real
value -- it is just duplicating what is available elsewhere, and adds
to the maintainance burden of Django.
Regards,
Luke
[1] http://www.lastcraft.com/fakemail.php
--
"Mediocrity: It takes a lot less time, and most people don't realise
until it's too late." (despair.com)
Luke Plant || http://lukeplant.me.uk/
I'm not sure I agree, Luke. Part of the reason for the success of
Django is that it is useful out of the box. You can do all the basic
development activities without needing to seek out or configure other
packages. If you find that the builtins aren't rich enough, you can
seek out alternatives, but the builtins are enough to get you off the
ground.
Following your reasoning, Django shouldn't have:
* the runserver command - after all, there is a mod_python and wsgi
interface, so you can deploy it using external tools
* the test command - after all, there are plenty of unit test running
tools out there.
I'm sure there are other examples. My point is that there is something
to be said for making it easy to get started, as long as the simple
approach doesn't rule out more sophisticated approaches for advanced
users.
On a different front; I would agree with you if Rob's suggestion
involved introducing an external dependency, or writing a lot of code
to support a test mail server. However, in this case, Python's SMTPd
library does all the heavy lifting. We just need to plumb it into the
runserver command.
To that end - I'd be inclined to follow the simple option here:
* We add a --with-mailserver option to runserver, which redirects the
EMAIL_* options as appropriate, and starts a mail server that just
dumps to the same console as the HTTP server.
* We add a standalone mailserver command so that you can run the same
basic stdout console logging mail server on a standalone console. This
would require the user to manually configure their settings to point
to the test mail server.
* If the Python SMTP debug server can be easily configured, maybe use
the verbosity command to control how much is dumped to console (0=just
the to: line, 1=just the header, 2=full message).
All the other fruit - database logged emails, etc - is out of scope -
this is a simple debug tool, nothing more. If you want a complex mail
handling solution, go get yourself a real mail server; the
documentation can point to a few options (like FakeMail).
On an administrative note - I've offered to mentor this activity
("Maybe" item Test-02 on the v1.1 plan). I'm willing to entertain the
idea that the right solution here is to abandon the idea altogether -
I just need to be convinced that it's the right thing to do. However,
if we abandon the idea, some documentation is definitely in order,
directing people to options like FakeMail.
Yours,
Russ Magee %-)