Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

An easy way to integrate with Braintree Payment Solutions from Django.

Project description


  • Install django_braintree (ideally in your virtualenv!) using pip or simply getting a copy of the code and putting it in a directory in your codebase.

    pip install tivix-django-braintree

  • Add django_braintree to your Django settings INSTALLED_APPS:

        INSTALLED_APPS = [
        # ...
  • Add these lines in file:

    BRAINTREE_MERCHANT = 'your_merchant_key'
    BRAINTREE_PUBLIC_KEY = 'your_public_key'
    BRAINTREE_PRIVATE_KEY = 'your_private_key'
    from braintree import Configuration, Environment
  • Add url to

    url(r'', include('django_braintree.urls')),
  • If you’re using South for schema migrations run python migrate django_braintree or simply do a syncdb.

Additional Information

  • Braintree uses default templates:

  • Braintree requires including the js from django_common that enables ajax forms etc. django_common is available at

  • If a template variable cc_form_post_url is passed to the template then this form posts to it, otherwise it posts to the url payments_billing.

  • If a template variable cc_form_success_redirect_url is passed it takes user to that url then after form post has succeeded.

  • Braintree is set up to sandbox mode at default. To change this you must switch Environment.Sandbox to Environment.Production in settings file.

Revision History

  • v0.1.2 Changed to be compatible with Django 1.4+
  • v0.1.3 Changed to be compatible with Django 1.5+

This opensource app is brought to you by Tivix, Inc. ( )

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tivix-django-braintree, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size tivix-django-braintree-0.1.3.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page