The code for codesy’s API backend combines:


Install Locally

codesy’s backend tries to be very slim, so starting should be easy. (Especially if you’re familiar with Django):

  1. Clone and change to the directory:

    git clone
    cd codesy
  2. Create and activate a virtual environment:

    virtualenv env
    source env/bin/activate
  3. Install requirements:

    pip install -r requirements.txt
  4. Copy decouple config env file:

    cp .env-dist .env
  5. Migrate DB tables

    ./ migrate
  6. Create a superuser:

    ./ createsuperuser

Run locally with https

The codesy browser extensions contain content scripts that execute on https:// domains and request resources from the codesy domain. So, you need to run the backend over https://. The easiest way to run https connections with Django is to run stunnel on in front of Django:

  1. First, install stunnel for your OS (E.g., on Mac OS brew install stunnel).

  2. Run Django dev server in HTTPS mode on port 5000:

    HTTPS=1 ./ runserver
  3. Generate local cert and key file for stunnel:

    openssl req -new -x509 -days 9999 -nodes -out stunnel/stunnel.pem -keyout stunnel/stunnel.pem
  4. Run stunnel with the included dev_https config:

    stunnel stunnel/dev_https
  5. Go to and confirm the certificate exception.


You always need to run both runserver and stunnel.

Read the Chrome Extension docs and the Firefox Add-on docs too learn how to configure them to use

Finally, you’ll need to enable GitHub authentication ...

Enable GitHub Auth

To enable GitHub authentication, you can use our codesy-local OAuth app.

Add a django-allauth social app for GitHub:

  • Provider: GitHub
  • Name: codesy-local
  • Client id: c040becacd90c91a935a
  • Secret key: 08c3da1421bb280e6fa5f61c05afd0c3128a2f9f
  • Sites: -> Chosen sites

Now you can sign in with GitHub at


codesy is pre-configured to use the balanced.js test marketplace. So, you can use the test credit card numbers and test bank accounts from the balanced docs.

Run the Tests

Install test requirements:

pip install -r requirements-test.txt

Running the test suite is easy:

./ test -s --noinput --logging-clear-handlers

What to work on

We have Issues.

If you are an active codesy user, we love getting pull requests that “scratch your own itch” and help the entire codesy community.

Deploy your own

codesy is designed to run on heroku, so you can easily deploy your changes to your own heroku app with heroku toolbelt.

  1. Create a heroku remote. We strongly suggest naming it codesy-username:

    heroku apps:create codesy-username
  2. Set a DJANGO_SECRET_KEY on heroku that’s unique to you.:

    heroku config:set DJANGO_SECRET_KEY="username-birthdate"
  3. Set other required environment variables for heroku:

    heroku config:set DJANGO_DEBUG=True
    heroku config:set ACCOUNT_EMAIL_VERIFICATION=none
    heroku config:set ACCOUNT_DEFAULT_HTTP_PROTOCOL='https'
  4. Push code to the heroku remote:

    git push heroku master
  5. Migrate DB tables:

    heroku run python migrate
  6. Create a superuser:

    heroku run python createsuperuser
  7. To enable GitHub sign-ins on your heroku domain, use the following settings to register your own GitHub App:


    You must use https

  8. Now go to to enable GitHub Auth on your heroku domain, using your new GitHub App Client ID and Secret


    Remember to use https

  9. That’s it. should work.

Read the Chrome Extension docs and the Firefox Add-on docs too learn how to configure them to use

Deploying to production

We use Travis CI for continuous deployment to Heroku. Our .travis.yml defines the flow:

  1. Commits to master are tested on Travis.
  2. If/when the build passes, the code is automatically deployed to
  3. To deploy changes to production, a repo owner pushes a commit to the production branch on GitHub.

This means a production deployment is as easy as a Pull Request. Click here to Request the next deployment from master to production.