Merge pull request #93 from hzy-/patch-1

Added Django usage instructions
This commit is contained in:
Samuel Cochran 2013-05-30 21:40:57 -07:00
commit a06f51d4bb
1 changed files with 13 additions and 0 deletions

View File

@ -63,6 +63,19 @@ You can do this in an [Apache htaccess file](http://php.net/manual/en/configurat
If you've installed via RVM this probably won't work unless you've manually added your RVM bin paths to your system environment's PATH. In that case, run `which catchmail` and put that path into the `sendmail_path` directive above instead of `/usr/bin/env catchmail`.
### Django
For use in Django, simply add the following configuration to your projects' settings.py
```python
if DEBUG:
EMAIL_HOST = '127.0.0.1'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 1025
EMAIL_USE_TLS = False
```
### API
A fairly RESTful URL schema means you can download a list of messages in JSON from `/messages`, each message's metadata with `/messages/:id.json`, and then the pertinent parts with `/messages/:id.html` and `/messages/:id.plain` for the default HTML and plain text version, `/messages/:id/:cid` for individual attachments by CID, or the whole message with `/messages/:id.source`.