Braintree for Django
djbraintree easily integrates the official Braintree Python client library into your Django applications by allowing easy configuration from your Django settings.
Quick start
Install djbraintree from PyPI:
$ pip install djbraintree
Update your project’s settings.py:
INSTALLED_APPS = ( .. 'django_barintree', ) TEMPLATE_CONTEXT_PROCESSORS = ( .. 'djbraintree.context_processsors.braintree_client_side_encryption_key', ) import braintree BRAINTREE_ENVIRONMENT = braintree.Environment.Sandbox BRAINTREE_CLIENT_SIDE_ENCRYPTION_KEY = '..' BRAINTREE_MERCHANT_ID = '..' BRAINTREE_PUBLIC_KEY = '..' BRAINTREE_PRIVATE_KEY = '..'Start using the Braintree Python client library in your code:
import braintree result = braintree.Transaction.sale({ "amount": "1000.00", "credit_card": { "number": "4111111111111111", "expiration_date": "05/2012" } })
Configuration options
- BRAINTREE_ENVIRONMENT
Braintree environment. Refer to the Braintree Python client library documentation for more details.
- BRAINTREE_CLIENT_SIDE_ENCRYPTION_KEY
Optional client side encryption key. Will be exposed using the braintree_client_side_encryption_key context processor as BRAINTREE_CLIENT_SIDE_ENCRYPTION_KEY in your templates if set.
- BRAINTREE_MERCHANT_ID
Merchant ID.
- BRAINTREE_PUBLIC_KEY
Public key.
- BRAINTREE_PRIVATE_KEY
Private key.
- BRAINTREE_USE_UNSAFE_SSL
Allow unsafe SSL connections. Default False and highly discouraged.
Metadata
Release files for djbraintree 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| djbraintree-0.1.0.tar.gz | 2.5 kB | Without provenance | Details |
Release files / djbraintree-0.1.0.tar.gz
| Download URL | djbraintree-0.1.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c95e0b5f0f1b326d3d7cc3e789c4d172a3457aae389875527274328b6f590af6
|
|
BLAKE2b-256 checksum How to use checksums |
d272c8ee4b104f499b7d4ece01248fada161ed1a3ef93db3025253e09022525a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for djbraintree 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.