Djangomailup¶


Django app to integrate with MailUp
Documentation¶
The full documentation is at https://djangomailup.readthedocs.org.
Requirements¶
- OAuth2 tokens for the MailUp REST API
- MailUp account
- Django >= 1.8
- python 2.7+, 3.4+
Quickstart¶
Install djangomailup:
pip install djangomailup
Add configuration in settings.py:
INSTALLED_APPS = [
'djangomailup',
]
MAILUP = {
"default": {
"client_id": "client_id",
"client_secret": "client_secret",
"username": "m1234",
"password": "password",
},
}
Then use it in a project:
from djangomailup import MailUpClient
client = MailUpClient()
Features¶
- TODO
Running Tests¶
Does the code actually work?
$ pip install -r requirements_test.txt
$ python runtests.py
Credits¶
Tools used this package:
Djangomailup¶


Django app to integrate with MailUp
Documentation¶
The full documentation is at https://djangomailup.readthedocs.org.
Requirements¶
- OAuth2 tokens for the MailUp REST API
- MailUp account
- Django >= 1.8
- python 2.7+, 3.4+
Quickstart¶
Install djangomailup:
pip install djangomailup
Add configuration in settings.py:
INSTALLED_APPS = [
'djangomailup',
]
MAILUP = {
"default": {
"client_id": "client_id",
"client_secret": "client_secret",
"username": "m1234",
"password": "password",
},
}
Then use it in a project:
from djangomailup import MailUpClient
client = MailUpClient()
Features¶
- TODO
Running Tests¶
Does the code actually work?
$ pip install -r requirements_test.txt
$ python runtests.py
Installation¶
Run this simple command in your terminal:
pip install djangomailup
Add 'djangomailup'
to your INSTALLED_APPS
setting:
INSTALLED_APPS = [
... # other apps
'djangomailup',
]
Then add MAILUP
configurations in your settings like:
MAILUP = {
"default": {
"client_id": "client_id",
"client_secret": "client_secret",
"username": "m1234",
"password": "password",
},
}
where:
default
: is the name of configurationclient_id
andclient_secret
are tokens for MailUp API RESTusername
andpassword
are credentials for MailUp account
Usage¶
To use djangomailup in a project:
from djangomailup import MailUpClient
client = MailUpClient()
# return account info
info = client.get_info()
Session¶
AuthenticateSession
is a low level objects to send http request to MailUp,
it’s perfect to check your configuration or try an unsupported endpoint.
This is probably the easiest way to connect with MailUp.
-
class
djangomailup.
AuthenticateSession
(using='default')[source]¶ A requests authenticated
Session
.Parameters: using (string) – name of MAILUP configuration (default: ‘default’) Same of
Session
, with oAuth2 logic.Usage:
>>> form djangomailup import AuthenticateSession >>> s = AuthenticateSession() >>> url = 'https://services.mailup.com/' >>> s.get(url) <Response [200]>
To use a different configuration use
using
argument:... >>> s = AuthenticateSession(using='myotherconfiguration') ...
Client¶
MailUpClient
is an AuthenticateSession
with every built-in request to work with MailUp.
-
class
djangomailup.
MailUpClient
(using='default')[source]¶ MailUp client for django.
A requests authenticated
Session
.Parameters: using (string) – name of MAILUP configuration (default: ‘default’) Same of
Session
, with oAuth2 logic.Usage:
>>> form djangomailup import MailUpClient() >>> s = MailUpClient() >>> s.get_info() <Response [200]>
To use a different configuration use
using
argument:... >>> s = MailUpClient(using='myotherconfiguration') ...
-
get_info
()[source]¶ Return MailUp Account Info.
Take a look at MailUp’s documentation if you want know more about Account Info
Reference: Account Info
-
Contributing¶
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions¶
Report Bugs¶
Report bugs at https://github.com/simobasso/djangomailup/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Fix Bugs¶
Look through the GitHub issues for bugs. Anything tagged with “bug” is open to whoever wants to implement it.
Implement Features¶
Look through the GitHub issues for features. Anything tagged with “feature” is open to whoever wants to implement it.
Write Documentation¶
djangomailup could always use more documentation, whether as part of the official djangomailup docs, in docstrings, or even on the web in blog posts, articles, and such.
Submit Feedback¶
The best way to send feedback is to file an issue at https://github.com/simobasso/djangomailup/issues.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Get Started!¶
Ready to contribute? Here’s how to set up djangomailup for local development.
Fork the djangomailup repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/djangomailup.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv djangomailup $ cd djangomailup/ $ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ flake8 djangomailup tests $ python setup.py test $ tox
To get flake8 and tox, just pip install them into your virtualenv.
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
- The pull request should work for Python 2.7, 3.4, and 3.5 and for PyPy. Check https://travis-ci.org/simobasso/djangomailup/pull_requests and make sure that the tests pass for all supported Python versions.
Credits¶
Development Lead¶
- Simone Basso <simone.basso@maieuticallabs.it>
Contributors¶
None yet. Why not be the first?