Skip to main content

Reusable backend to accept & track donations to your site

Project description

Django Donations

https://img.shields.io/travis/founders4schools/django-donations.svg?style=flat-square https://img.shields.io/coveralls/founders4schools/django-donations.svg?style=flat-square Code Health https://img.shields.io/requires/github/founders4schools/django-donations.svg?style=flat-square https://badge.fury.io/py/django-donations.svg

Quick Start

Easiest way to install is via pip:

pip install django-donations

Then add the app to your settings.py:

INSTALLED_APPS = (
    ...
    'donations',
    ...
)

from donations import setup
setup()

And to your urls patterns:

urlpatterns = patterns(
    ...
    url(r'^donate/', include('donations.urls')),
    ...
)

Just Giving Configuration

The app needs to be configured with your JustGiving API settings:

# Ability to point to Production or Sandbox URLs
JUST_GIVING_WEB_URL = 'http://v3-sandbox.justgiving.com'
JUST_GIVING_API_URL = 'http://api-sandbox.justgiving.com'
# Replace below with your personal details
JUST_GIVING_CHARITY_ID = '123456'
JUST_GIVING_APP_ID = 'changeme'
# Add a list of all the currencies you need to support
CURRENCIES = ['GBP']

With django autoconfig

Some of the setup is in database, you need to create a Provider and donation frequencies. To make it easier to set them up, we recommend to use django autoconfig, which will load the required objects when starting up. The only thing that needs to be added to your settings.py is:

from django_autoconfig.autoconfig import configure_settings
configure_settings(globals())

Manually

TODO

TODO

  • Update the documentation and readme

  • integrate with readthedocs or pythonhosted or both!

  • tests - unit/integration

  • task to periodically verify pending donations

(* dashboard - track/view donations from the business side - kpis etc * views/urls? - provide an api hook into the system (/donations - dashboard))

v2 and beyond

  • (other providers (paypal etc))

  • tasks.py - recurring donation handling - this is not possible right now as SDI is not an API to be automated

Usage

Example app is under ./example/app. Basically subclass DonateView or POST to DonateAPI with the correct data…. (example needed) When using DonateView, there is the DonationForm which can be subclassed to customize or just used by itself.

Settings

Supported Providers

  • Just Giving SDI

Basic Commands - Update to be correct

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run manage.py test
$ coverage html
$ open htmlcov/index.html

Running end to end integration tests

N.B. The integration tests will not run on Windows.

To install the test runner:

$ pip install hitch

To run the tests, enter the django-donations/tests directory and run the following commands:

$ hitch init

Then run the stub test:

$ hitch test stub.test

This will download and compile python, postgres and redis and install all python requirements so the first time it runs it may take a while.

Subsequent test runs will be much quicker.

The testing framework runs Django, Celery (if enabled), Postgres, HitchSMTP (a mock SMTP server), Firefox/Selenium and Redis.*/

Create a New Release

This project is configured to use bumpversion, only prerequisite is to have it installed. When the tests have passed and you’re happy with the code base, just need to run:

$ bumpversion [major|minor|patch]

Depending on which digit of the version needs to be updated, and then push with tags:

$ git push --tags

Travis will take care of creating a new packaged, and upload it to PyPi.

Project details


Download files

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

Source Distribution

django-donations-0.2.7.tar.gz (16.5 kB view details)

Uploaded Source

Built Distributions

django_donations-0.2.7-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

django_donations-0.2.7-py2-none-any.whl (21.8 kB view details)

Uploaded Python 2

File details

Details for the file django-donations-0.2.7.tar.gz.

File metadata

File hashes

Hashes for django-donations-0.2.7.tar.gz
Algorithm Hash digest
SHA256 da75d026a0e3b0d0e9ddd1e60680cbbe92b79369b34a6bf4f489602c468dfab5
MD5 9844403b09134f8c36f15ef5653eb89b
BLAKE2b-256 be01b997a7f11802467e8666ed1154db52a5562c72866684108e28ac4879e0f2

See more details on using hashes here.

File details

Details for the file django_donations-0.2.7-py3-none-any.whl.

File metadata

File hashes

Hashes for django_donations-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bea0b3c61253d5d4238dd8d00401c65a8aee315c165dad075ca0ffb034df321a
MD5 7a628c6b65751a9a9a53e72bdf464f45
BLAKE2b-256 695a10c191bff5af6cbb24bee7c4d82af1b80d53c499b9fc3d281642d4ffd0b3

See more details on using hashes here.

File details

Details for the file django_donations-0.2.7-py2-none-any.whl.

File metadata

File hashes

Hashes for django_donations-0.2.7-py2-none-any.whl
Algorithm Hash digest
SHA256 18b9b384161bd5b311aa7b54c5ae2bc7cabf062094c60aa29ebee3d5ccb26302
MD5 1b049a249f9fdd458b0a7ec89ae238b2
BLAKE2b-256 f296797c46bec4491d139f6dd019e8ec9ca7b6fcc8da5d92d51e5e384e3a5dd2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page