Latest Activity
Welcome to my site! I'm a web developer in Lawrence, KS, and I like blogging about Django stuff. Below you can check out what I've been up to lately.
29
Commit 28998b for Project Euler
Have a brute force for 66 but it hangs when D = 61...needs more work
29
Commit affdcb for Project Euler
Solved 65
29
Commit 38117e for Project Euler
Solved 64
27
Announcing djangoembed, rich media consuming and providing with Django
2 Comments | Tags: django oembed
I'm pleased to announce the release of djangoembed, a django app for consuming and providing rich media.
What is OEmbed?
OEmbed is a format for allowing a rich representation of a url. If you've used Facebook you've probably seen this feature before -- linking a YouTube video will embed an actual video player in the news feed, automatically. The player is represented by some HTML, plus there may be additional metadata like the author, a link to their channel, the title of the video, or even a thumbnail.
Fixing a bungled setup.py copy/paste foul
05
Commit 12ba4c for django-site-gen
Fixes to the Nginx conf
03
Using virtualenv, pip and django-site-gen to quickly start new Django projects
4 Comments | Tags: django pip virtualenv
Last week, after several false starts, I moved all the sites I maintain into virtualenvs, with their own pip requirements files. My reasons for doing so are pretty simple:
- Experimenting with new/different versions of software is a pain in the ass without isolation
- A pip requirements file for each site is a very nice thing to behold
- I symlink 3rd party apps into a custom directory on my PYTHONPATH and it was getting huge
- Profit
There are quite a few great tutorials out there for getting started with these tools. I will only discuss how I got over some of the hurdles involved in using these tools, as well as a tool for automating the creation of "skeleton" django sites.
Apache Solr is a fast, open-source search solution. People are doing some very cool things with Solr. I personally have only begun to scratch the surface of what is possible with Solr, but have seen amazing returns with a relatively small investment (thanks entirely to Daniel Lindsley's excellent search framework, django-haystack). There are instructions for getting up and running with Solr + Jetty -- the purpose of this blog entry is to walk through setting up multi-core Solr with Apache Tomcat.
To get the benefit of Django 1.2's new CSRF protection, all POST forms will need a special token. Here is a quick command that runs through templates adding the token:
find . -type f -name "*.html" -exec sed -i \
's|\(<form[^>]*method="post"[^>]*>\)\({% csrf_token %}\)\?|\1{% csrf_token %}|g' \
{} \;

