Pages: 1 2

Deployment System Requirements

Over the past month, my colleague Kurtis and I have been engineering a fully automated deployment system for all of our projects at work. This system was created to remove the painful deployment process from our development environment. This article discusses the requirements that we had for our deployment system. I eventually hope to discuss the entire thing, how we built it, and what revisions we make.

Why Deploying Can Be Painful

Most programmers hate deploying code. I certainly did until this past year. Deploying code is (often times) much harder than writing the code itself. Deploying requires a great deal of knowledge: OS configuration and setup, cloud provider APIs or physical server installation quirks, numerous software components, system monitoring, access lists, and a lot of other things.

It's a pain.

...

Read more

There are no comments on this post.

What's Up With the 'File' Menu?

firefox file menu

I'm no usability expert. In fact, I've been called tasteless by many people (my wife included), but what the hell is up with pretty much all programs having a 'File' menu?

http://dictionary.reference.com/ defines 'file' as:

...

Read more

There are no comments on this post.

Why Don't You Use virtualenvwrapper?

If you're a python programmer, you've most likely heard of [virtualenv][a]. If you haven't, then you need to check it out.

virtualenv is a tool to create isolated Python environments.

In a nutshell, you can create as many virtual environments as you want. Each of these virtual environments is a small directory structure, which contains a copy of your python interpreter(s), and provides a sandbox environment in which you can install only the necessary packages you need to run your project, as well as remove your programs' dependence on system packages and python versions.

...

Read more

There are no comments on this post.

How to Streamline Asterisk

So, you use Asterisk professionally, for fun, or both, and you want to know how to optimize the shit out of your Asterisk platform? No problem, I've got you covered.

Grab a beer, free up the next 2 hours of your time, and let's get to it!

...

Read more

There are no comments on this post.

Python Challenge Thoughts

If you didn't read my previous post, you'll want to check that out first: The Purely Functional Python Brainfuck Challenge.

So, today was the first day I really invested some thought and time into the challenge. I decided that before just diving into code I'd spend some time reading up on functional programming in python, and learn a bit.

The first thing I read through was the official python functional programming page which you can find here. This had a bunch of useful information regarding functional programming tools in python, but didn't really have any examples of actual functional programs.

...

Read more

There are no comments on this post.

Serving Static Content With Django

A question that is frequently asked by new Django programmers is: "How can I serve static content (css, images, javascript) with the Django development server?". This article is my attempt to answer that question by demonstrating the best practices way to do so.

Why Doesn't Django Serve Static Content Automatically?

Well, Django (and python in general) is built around the idea that it is better to be explicit than implicit. This concept means that you may need to write more code in order to do something, but that by doing it that way, you preserve code clarity and reduce complexity.

...

Read more

There are 3 comments on this post.

Populating Default ManyToMany Field Values in Django

At work, I'm the lead developer of a rather large, complex web application which interacts with many different technologies (Asterisk, Freeswitch, Cisco routers, python, XML-RPC, JSON, Django--to name a few). A few days ago, while implementing a ban system, I bumped into an interesting problem that was not trivial to find a solution to. So, here it is :)

Background

The web application I'm developing is a private portal which allows users to manage teleconference lines real time. Since all of our telephony services are free of charge, we often get callers onto certain teleconference lines who want to abuse services (think of those trolls on the internet, except over the phone). As you can probably imagine, without strict regulation & technology in place, telephone trolls could cause huge problems for normal users.

...

Read more

There is 1 comment on this post.

The Asterisk Spooling Daemon

While working on the new v2 release of pycall, I was doing some research on the internal limitations of Asterisk call files, and thought I'd share some interesting (technical) bits of information here.

All information below has been gathered from the latest Asterisk release (v1.6.2.7). If you don't do any programming, you may want to skip this article, as it is a bit geeky.

...

Read more

There are no comments on this post.

Basic XML Parsing with Python and LXML

Recently I've been developing an API using python and Django for work, which uses XML responses to speak to clients. One of my goals for the client was to be able to easily parse the XML responses that the server sends, so that I could appropriately handle errors.

Fortunately, python has many tools for building and parsing XML. During my research, I tested several options, but found that the well supported library LXML was a perfect match for what I needed. Unfortunately, I had a hard time figuring this out, as examples to just parse XML content was lacking in the official tutorial, and there were no good resources online with code samples.

So let's take a quick peek at a sample XML document, then we'll analyze some simple LXML code to see how it works. Of course, before you can run any of these code samples, you'll need to download and install LXML (there are packages available on most linux systems already).

...

Read more

There are no comments on this post.

Auto Generate Forms With Django's ModelForm

In this short article, we'll analyze a better way (in some cases) to create forms for your Django models.

If you've ever worked with Django forms, then you know that there is a lot of repetitive code involved in the process of writing a form to create your model. Take, for instance, the following model, which represents a physical server (somewhere):

from django.db import models
 
class Server(models.Model):
    """
    This class represents a physical server.
    """
    hostname = models.CharField('Server Name',
        help_text = 'Hostname of the server.',
        max_length = 50
    )
    ip = models.IPAddressField('Server IP Address',
        help_text = 'Public IP of the server.',
        unique = True
    )
    disk_space = models.IntegerField('Disk Space on Server',
        help_text = 'Total disk space in MB.'
    )
    ram = models.IntegerField('RAM on Server',
        help_text = 'Total RAM in MB.'
    )
    cpu = models.IntegerField('Processing Power',
        help_text = 'Total Processing Power in MHz.'
    )
 
    def __unicode__(self):
        """
        Make the model human readable.
        """
        return self.hostname

...

Read more

There are 4 comments on this post.

Pages: 1 2

Powered by Debian, Guinness, and excessive quantities of caffeine and sugar.