Codekarate Content

By shane
Sat, 2012-03-31 15:22

In my last post I discussed setting up a Payment Form in Django for entering credit card information. Here is how I tied it in on the back-end to integrate with Recurly for the recurring payments on getpropeller.

I added the following to a file called and added it to one of my Django Apps. It provides a light wrapper around the Recurly Python library.

class SubscriptionManager:
  A class that handles the subscriptions on Propeller
  def __init__(self, company):
By shane
Sat, 2012-03-31 01:35

Was not able to find a drop in example of a Payment form for Django that worked for me on to hook into Recurly's API for recurring payments. I found a few Django snippets that got me close, but had to make some modifications to get things working.

Here is what I came up with for my file:

class CreditCardField(forms.IntegerField):
  def get_cc_type(self, number):
    Gets credit card type given number. Based on values from Wikipedia page
    "Credit card number".
    <a href="


By shane
Thu, 2012-03-08 20:39

I am using Recurly for recurring payments on the Propeller website. This site is a Django web site running on Heroku. I needed to fully integrate recurring payments so I opted to use Recurly's API instead of any type of hosted or JS form version. This required a good deal of work (and it is still not finished) but is definitely worth the effort.

By shane
Thu, 2012-03-08 10:44

At first I was a little hesitant to virtual environments in Django. Not because I didn't think it was a good idea, but because it seemed like a lot of extra work. After finally spending some time learning more about it, I can tell you that overall it is pretty easy and I would highly recommend it for all Django development.

Using Virtual environments not only makes rebuilding your environments easier, it also makes deploying to a service such as Heroku or Google App Engine possible. Here is the general workflow I use when dealing with virtual environments.

Create environment