Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Django library for connecting to Basket

branch: add-env-var-su…

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 basket
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rst

Basket Client

This is a client for Mozilla's email subscription service, basket. Basket is not a real subscription service, but it talks to a real one and we don't really care who/what it is.

There are four API methods: subscribe, unsubscribe, user, and update_user. View the basket documentation for details.


Are you looking to integrate this on a site for email subscriptions? All you need to do is:

import basket

basket.subscribe('<email>', '<newsletter>', <kwargs>)

You can pass additional fields as keyword arguments, such as format and country. For a list of available fields and newsletters, see the basket documentation.

Are you checking to see if a user was successfully subscribed? You can use the debug-user method like so:

import basket

basket.debug_user('<email>', '<supertoken>')

And it return full details about the user. <supertoken> is a special token that grants you admin access to the data. Check with the developers to get it.


URL to basket server, e.g.

If you're using Django you can simply add this setting to your file. Otherwise basket-client will look for this value in a BASKET_URL environment variable. The default is http://localhost:8000.

Something went wrong with that request. Please try again.