Caktus Blog
2013

ShipIt Day 4: SaltStack, Front-end Exploration, and Django Core
Last week everyone at Caktus stepped away from client work for a day and a half to focus on learning and experimenting. This was our fourth ShipIt day at Caktus, our first being almost exactly a year ago. Each time we all learn a ton, not only by diving head first into something new, but also by hearing the experiences of everyone else on the team.

UNC, Duke Team up with Carrboro-based Caktus Group on HIV Gaming App
The following is a press release posted in partnership with our team at UNC and Duke.
The web application development company Caktus Group has teamed up with researchers at the UNC Institute for Global Health & Infectious Diseases and the Duke Global Health Institute to develop a mobile phone app that may help patients better adhere to their medication regimens.

Skipping Test DB Creation
We are always looking for ways to make our tests run faster. That means
writing tests which don't preform I/O (DB reads/writes, disk
reads/writes) when possible. Django has a collection of TestCase
subclasses
for different use cases. The common TestCase
handles the fixture
loading and the creation the of TestClient
. It uses the database
transactions to ensure that the database state is reset for every test.
That is it wraps each test in a transaction and rolls it back once the
test is over. Any transaction management inside the test becomes a
no-op. Since [TestCase]{.title-ref}[ overrides the transaction
facilities, if you need to test the transactional behavior of a piece of
code you can instead use
]{.title-ref}[TransactionTestCase]{.title-ref}[.
]{.title-ref}[TransactionTestCase]{.title-ref}` resets the database
after the test runs by truncating all tables which is much slower than
rolling back the transaction particularly if you have a large number of
tables.

Central logging in Django with Graylog2 and graypy
Django's logging configuration facilities, which arrived in version 1.3, have greatly eased (and standardized) the process of configuring logging for Django projects. When building complex and interactive web applications at Caktus, we've found that detailed (and properly configured!) logs are key to successful and efficient debugging. Another step in that process — which can be particularly useful in environments where you have multiple web servers — is setting up a centralized logging server to receive all your logs and make them available through an easily accessible web interface. There are a number useful tools to do this, but one we've found that works quite well is Graylog2. Installing and configuring Graylog2 is outside the scope of this post, but there are plenty of tutorials on how to do so accessible through your search engine of choice.

Caktus Participates in DjangoCon 2013
Caktus is happy to be involved in this year’s DjangoCon hosted in Chicago. We are pumped about the great lineup of speakers and can’t wait to see some of our old friends as well as meet some new folks. Beyond going to see the wonderful talks, Caktus is participating as a sponsor and Tobias McNulty will be speaking on scaling Django web apps. Come stop by our booth or see Tobias’ talk to connect with us.

Raspberry IO Open Sourced
Back in March, at PyCon 2013, the PSF provided each attendee with a Raspberry Pi, a tiny credit-card sized computer meant to be paired with the Python programming language. The power and portability of the Raspberry Pi has stimulated an explosion of interest among hobbyists and educators. Their uses seem to be limited only by our collective imagination.

Migrating to a Custom User Model in Django
UPDATE: Read a newer blog post on this topic.
The new custom user model
configuration
that arrived in Django makes it relatively straightforward to swap in
your own model for the Django user model. In most cases, Django's
built-in User
model works just fine, but there are times when certain
limitations (such as the length of the email
field)
require a custom user model to be installed. If you're starting out
with a custom user model, setup and configuration are relatively
straightforward, but if you need to migrate an existing legacy project
(e.g., one that started out in Django 1.4 or earlier), there are a few
gotchas that you might run into. We did this recently for one of our
larger, long-term client projects at Caktus, and here's an outline of
how we'd recommend tackling this issue:

Mark & Julia Speaking at OSCON. “Developers + Designers: Collaborating on your Open Source project”
On Wednesday, Mark and Julia are teaming up to deliver their talk "Developers + Designers: Collaborating on your Open Source project " at OSCON 2013. We’re thrilled that their talk got accepted and know that they have a lot to contribute to the Open Source conversation which too often lacks the voice of designers. Julia and Mark will be discussing how it is important to start collaborating early on your ideas before writing code. We’re happy to have such adept developers and designers here at Caktus pushing each other to work outside of their strict job titles and collaborate to build projects that couldn’t be built anywhere else. If you are at OSCON this week, stop by and hear Mark and Julia’s talk. Or, if you miss their talk, they will be around all week and are excited about meeting new people.

Factory Boy as an Alternative to Django Testing Fixtures
When testing a Django application you often need to populate the test
database with some sample data. The standard Django TestCase
has
support for fixture loading but there are a number of problems with
using fixtures:

Caktus is hiring a Design Visionary and User Experience Virtuoso with a Knack for Coding
Do your mornings usually consist of reading design blogs and drinking coffee? Are you obsessive about fonts? Are you constantly seeking out new inspiration to make your designs better? As a Front-End Developer + Designer at Caktus, you’ll be able to put your passion for design and development to work by creating beautiful designs for complex websites. You will work closely with clients to bring their visions to life and help lead the branding and design process. Our designers take ownership of the user experience and design process from the beginning and collaborate with our development team to implement the vision. You should be passionate about the open source community and the philosophy behind it. If you’re interested in becoming part of and contributing to a creative, dynamic team, here’s an idea of what you’ll do: