Brad's Blog

web dev, django, running, food, or whatever

Published: 2015-09-03

Disabling the Forms in Django Rest Framework's Browsable API

api django djangorestframework python restframework

If you're building a RESTful api using django, then you're probably aware of Django Rest Framework. It's a great project that will do a lot of the heavy lifting for you. It's also got this really really nice featur: the browsable api. The browsable api gives you out-of-the box access to view your api, and even to interact with it using some auto-generated forms. This is great during development, because you can quickly see exaclty how ...

Published: 2015-08-30

Webucator: zip, map, and lambda

lambda map programming python tutorial zip

Recently, the folks from Webucator, who have a series of python tutorials got in touch with me about one of my blog posts: Python's zip, map, and lambda. They wanted to turn that article into a tutorial video. I thought that sounded like a pretty cool idea, so if you're into video tutorials, give this a view. And check out some of their other tutorials as well.

Published: 2015-08-26

A django iconbool filter

django filter python

Django's template laguage includes a lot of really useful built-in tags and filters, but sometimes you just need to build your own. There are many reasons why you might want to do this, but I'm lazy, and I like to build filters and tags that let me take shortcuts in the template. Here's one example of a simple filter that let's me be lazy: an iconbool filter. Motivation I really like Font-Awesome, and any time I ...

Published: 2015-04-25

Nice ArrayField widgets with choices and chosen.js

arrayfield django postgresql python

One of the really cool new features in Django 1.8 is the support for Postgres-specific fields. I'm very excited to be able to use things like PostgreSQL arrays or hstore without 3rd-party add-ons. Unfortnately, the default form inputs for ArrayFields are less than stellar. So, in this post I want to explore a few things: a Model who's ArrayField only accepts items from a set of predefined choices a ModelForm that makes use of chosen.js (which ...

Published: 2015-03-17

Django hack: Help text on a model instance

curry django functional

If you've been been working with Django for a while, you're probably familiar with the help_text attribute for model fields. It gives us a hook for adding descriptive text that gets automatically included on forms or in the admin. But what if you want to access that same information on an instance of model object? Let's look at an example! Assume we have a simple model: class BlogPost(models.Model): title = models.CharField( max_length=50, unique=True ...

Published: 2014-12-01


comedy computing technology

This is a bit of rant. I'm currently checking (triaging, really) my email, and I've decided to click all the unsubscribe links in the marketing emails. The thing is, I've already done this. Many times. For many of these, I've just started reporting them as spam. I'm sorry, but if you ignore the fact that I've unsubscribed from your email, I'm calling you a spammer. Of course, about half the time I'm ...

Published: 2014-10-18

Running Miles, Curing Cancer

donate running stjude

Yesterday, I decided (mostly on a whim) to run the St Jude Memphis Marathon. It's a race supporting St. Jude Children's research hospital which provides treatment and research for major childhood illnesses such as Cancer and leukemia. The really cool thing about St Jude is that they provide treatment that is 100% free of charge to the families that suffer through these diseases. From their website, "Families never receive a bill from St. Jude for treatment, travel, housing ...

Published: 2014-09-21

#HACKMemphis 2014

hackmemphis memtech

The second annual HACKmemphis happened (is still happening, actually) this weekend, and it's been a blast. I went into the event with lots of ideas, but with very few expectations for myself. My Goals: Hang out with friends (new & old) and have fun. Mission Accomplished! I did build some stuff, too, so I feel pretty good about that. The stuff includes a simple, fun little app, improvements to an Alfred Workflow, and some improvements to Elvis, our community ...

Published: 2014-06-25

My Development Environment

development environment software tools

Every once in a while, I like to step back and take a look at the tools that I use. I don't change my development environment very often, but I do periodically pull in a new tool here and there. Sometimes they fit into my workflow, and sometimes they don't. As far as I know, I've never written my thoughts down when doing this, but in an attempt to keep in line with my Write more. Share ...

Published: 2014-03-21

Your VM has become "inaccessible."

vagrant virtualbox

Today I ran out of disk space on my Macbook Air. I mean, completely out of space. I use vagrant and Virtualbox for work, and I knew that had several large, but older snapshots of virtual machines that I could remove to free up space. And that's how today fell apart. I also use the vagrant-vbox-snapshot plugin, and that's the tool I typically use to take snapshots when I need them. So, looking into my project folder, I ...