Skip to main content

A Django app providing database and form fields for credit cards.

Project description

django-credit-cards

A Django app providing database and form fields for credit cards.

Compatibility

  • django >= 1.8
  • python >= 3

Quickstart

Install django-credit-cards:

pip install django-credit-cards

Then add it to your models:

from creditcard.models import CardNumberField, CardExpiryField, SecurityCodeField

class Payment(models.Model):
    cc_number = CardNumberField(_('card number'))
    cc_expiry = CardExpiryField(_('expiration date'))
    cc_code = SecurityCodeField(_('security code'))

Or to your forms:

from creditcard.forms import CardNumberField, CardExpiryField, SecurityCodeField

class PaymentForm(forms.Form):
    cc_number = CardNumberField(label='Card Number')
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')

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-credit-cards-0.1.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

django_credit_cards-0.1-py2.py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 2 Python 3

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