Posts by Eric Holscher
When you are writing software, you build a mental model of the program in your brain. This is how you make decisions and reason about how the program might work, how data flows, or what designs make the most sense.
Self-documenting code is one of the biggest documentation myths in the software industry. This view generally conflates documentation with code comments. I’d like to make two arguments in this post:
At many conferences, people allow the audience to ask questions after the talks. I want to argue that this is an anti-pattern in many ways, and some solutions that have worked that I recommend.
- Oct 06, 2016
- Eric Holscher
- Portland, Oregon
- semantic meaning, markdown, reStructuredText, semantics, python
Semantic Meaning in documentation is the separation of what something is from what it looks like. What we mean and what we display are very different things.
Writing code is the act of building a mental model of a problem, and then translating that model into executable software.
Often times as developers we see funding open source as a charity. We will give our personal money to projects we believe in. If we’re lucky, our company might have a matching program for our donations. This has proven not to be a sustainable way to support open source.
Sphinx is a super powerful tool. This has its upsides and downsides. One of the major downsides is that historically it has been built as a framework that allows users to do just about anything. This is great, except it also means that a lot of the specific value out of the modular design hasn’t been documented or made explicit to users. I’m hoping to address some of this power in a set of blog posts.
Please send any feedback you have to me about this article! I’d love to help expand and explain it better if possible.
“Markdown” is the most commonly used lightweight markup language on the internet. It is great for a subset of tasks, mainly blog posts and commenting. However, lately it has been adopted by the technical writing community as a solution for writing documentation.
Conferences have been a fundamental part of me becoming a professional developer. Having a network of people you know personally in a professional context is a huge advantage. It helps getting jobs, they help you think through problems, and it’s important to help you identity as a member of the community.
There are a lot of reasons to build a new company. A large part of it is wanting something to exist in the world. However, there are ways to manifest things that don’t require a new company.
Today we are announcing a sustainability campaign to raise money for Read the Docs. Most of the information is available on the page there, but I wanted to shine a bit more light on my thinking about this process.
I helped create Read the Docs over four years ago. It started with a humble goal of replacing a cron job on my own server. Since then, it has grown more than I ever could have imagined. It has become vital infrastructure for the Python community, and the programming world in general.
We have some exciting news in Read the Docs land this week. The project has been accepted into the Portland Incubator Experiment, as an open source project. This means that we have office space provided to us in Portland for three months, where we will be working on Read the Docs full-time. There will be two of us working on this: Eric Holscher and Anthony Johnson.
As a developer, you develop instincts for judging quality of code. One of my favorite interview questions is:
I have heard a few times over the past couple months that Sphinx is “mainly for Python projects”. This line of thinking makes sense, because Sphinx was created to document Python itself. Sphinx however, is a generic documentation tool that is capable of documenting any software project.
2013 has been a fantastic year. In 2012, I decided that I would focus more on life than my career. This year has been a larger experiment along those lines. I have done a lot of good work on programming, but I have also taken a lot of time to spend for myself.
2013 has been a big year for Read the Docs. Our mission is to make documentation hosting easier, with the overall goal of increasing the quality of documentation in the programming world. I believe that we have been doing good work towards that goal, and I want to share some numbers to reflect our progress.
I helped organize my first conference last year, Write the Docs. It was a great experience, but was also rather stressful. Organizing things is an interesting exercise in managing fear and risk. There are so many possible outcomes, and this is scary as hell.
Or how I learned to stop worrying and write a book.
I’ve asked myself these questions a lot. Historically I have put Google Analytics on my doc pages, and called it good. I would browse over the data every once in a while, gleaning basically zero information out of it.
For a long time, there has been a live preview site for reStructuredText: http://rst.ninjs.org/. It is really fantastic for learning the language. The immediate feedback is really valuable in helping you expirment and see how things work.
A few days ago I started a campaign to improve documentation. Today I have the first results to show from this work.
A letter I wrote to an old friend Josh, after I had come home from the PCT. It was sent on August 7th, 2013. It captures my thoughts on the trail pretty well.
tl;dr: I don’t have (or want) a job, help fund me to make the documentation world better.
My time in Portland in winding down, and the trail is approaching in my minds eye. I leave on the 14th of April, and 6 in the morning. Setting out on a jet-plane to San Diego. I will spend the night on the 14th and be transported to the trailhead at sunrise the following day.
Documentation is one of the most important parts of a software project. However, a lot of projects have little or no documentation to help their (potential) users use the software. A few years ago we started Read the Docs to help make hosting documentation easier. Part of the reason was that if hosting documentation was a solved problem, it would make people more likely to write docs.
I’ve recently schemed some very large changes in my life, and I have been trying to figure out how to blog about it. It all starts with quitting my job at Urban Airship. I sent an email to the staff announcing my departure, and I can’t think of a better way to remember this moment in time than to include it in full in my blog. So, here is the letter I wrote to everyone at work when I left the company.
Wow, what a year. 2012 was a great year in my book. I took 2012 off from a lot of the professional development activies that have taken up my adult life thus far, and really focused on personal development. I think I did a great job with that, and I have a pretty awesome list of things I accomplished this year. I think I also started to get the full enjoyment out of Oregon this year, in all its seasons.
As the maintainer of Read the Docs, I spend a lot of time looking through random projects, and getting inspired. People have been doing lots of interesting things with the project, and I’d like to highlight some of them.
Currently Read the Docs is funded mainly through Corporate sponsorship. The Django and Python Software Foundations (non-profits), Mozilla, Lab305, Revsys, and others have helped keep the site running. However, this requires finding sponsors to help donate to the site every 6 months or so to keep things running.
A story about XOXO Festival in 3 acts. I will start first with something that set the tone, then talk about the importance to me, and then what I hope comes from it in the future.
Documenting projects is hard, hosting them shouldn’t be. Read the Docs was created to make hosting documentation simple. I think that we have solved this problem well, but now we need to start thinking about the larger picture.
It’s been a while since I last talked about Read the Docs, and there has been a lot of activity. This is an update on the latest and greatest new features.
Reviewboard is a great tool for managing the process of Code Reviews. It has pretty good git support, but it might not be obvious what the best way is to use it. At work, I have a couple of different ways of pushing up code for reviews, which I’ll talk about.
Documentation writing will always be hard work. It’s a much different mind-set than programming, and people that write good code might not necessarily write good docs. However, this is a known issue, and something that can’t really be solved.
I have seen a lot of talk over the past couple years about how to handle different settings files and databases, synced between production and development. I have happened onto a way of doing it that makes me happy, and figured I would share it with the world.
At work, we have a wiki page that’s called Required Reading. Named after that oh-so-lovely tradition in high school or college of having books that you needed to read over the summer before you started class. The idea being that they are relics of the culture of the company, and if you read everything, you will understand a lot about how work (and play) is done.
Over on ReadTheDocs, I wanted to build search around the documentation that we’re hosting. I chose Haystack and Solr for this, because it’s the best way to do search in Django these days. However, I’ve only ever used Haystack to index content that is in the database. I thought about trying to add all the rendered HTML from the documentation into the database, but that was a non-starter.
In my work in ReadTheDocs, we now support all of the major VCS repositories: svn, bzr, hg, and git. At this point in time we’re only checking out the repos to their default branches, and then trying to trying to update them again to another revision. While writing this code I have had at least 3 different bugs that caused the repos not to be updated correctly. So I’m going to detail here the exact code that allows me to do this for each of these types of repos, hopefully so that when you or I need to do this in the future, we can at least start from here.
Today I went ahead and flipped the switch on a couple of server migrations I’ve had queued up. One of these updates is moving ReadTheDocs over to its own dedicated server, that I built up over the week in my Chef Tutorials.
Alternate title: There’s no place like home!
Alternate title: Show the world what you’ve got.
Alternate title: Actually doing something useful.
Alternate title: Fucking Chef, How does it work?
I use IRC for work, play, and generic open source questions and support. I think it’s a pretty integral part of my existence as a developer. Today I’m going to write about why using an IRC bouncer makes IRC a ton better and show you how to get one setup.
When I was setting up the Django Hudson instance, I ran into a problem that seems like it should be pretty easy to solve. However, I couldn’t figure out a way. So at this point it’s looking like we’re going to have to use buildbot to build out what we want instead of Hudson. Wondering if I missed something obvious, or if this is a missing feature.
I have a couple of testing related applications in the Django community. I don’t have a good way of communicating with the users of these apps, namely about releases, or helping with support questions. So I am starting the Django Testing Mailing List for people that are interested in my testing projects: django-test-utils, django-crawler, and django-kong.
Following on yesterday’s post about Virtualenv Tips, I will be talking about celery tips. Yesterday I talked about how to run celery with upstart easily, and today I’ll be expanding on that below as well as talking about how to set it up using supervisord.
Virtualenv is a project that is indispensable for most Python devs these days. I am writing down some tips here so mainly for personal reference, and because I found them useful.
I just gave a talk title “Large problems, Mostly solved”, which you will recognize if you’ve been reading this blog for a little while. I took my past series of Large problems posts, and expanded on them into a full talk.
Since the Django Dash ended, We’ve been working on adding some requested new features to Read The Docs. There are a couple of major ones that we have added that I’d like to talk about.
Continuing from my previous post about Django Dash, I will be talking about another thing that I learned from the dash. This isn’t as big of a post, but just something that we ran into that caused us some trouble.
I have written a couple of different services that have needed to be required when your repository has had code committed to it. The normal path of getting this to happen is to ask your users to add your special URL to their list of post-commit hooks for their repository. However, once you have 3 or 4 or 10 services that need to do this, it becomes cumbersome. If I am a user that has 5 repos and I want to use 5 services, this is 25 times that I need to copy/paste some URLs into a form on a website.
This year’s Django Dash just came to an end, and I’m really excited about the project that we built. I’m sure the other teams are feeling just as stoked, because there is an amazing amount of awesome work that was done in the last 48 hours.
This is going to be a series of posts that talk about what I learned from the Django Dash. I think it’s a really fun competetion that is also a great learning experience. I hope that this series catch on, and other people write about some of the things that they learned in the Django Dash.
It’s conference season and I realized that I haven’t talked about any of the ones that I’ve been to or am going to, so I figured it would be a good post.
Django itself has shipped with a “semi-private” introspection API,
_meta, for a long time. I have created a drop-dead simple
wrapper on top of this.
* UPDATE*: There is a new thread about the roles and implementation of a Design Czar up on the Django Developers mailing list. Please contribute there as well, if you have thoughts and ideas.
* [This is part of the `Large Problems in Django Series <http://ericholscher.com/tag/largeproblems/>`_, see previous entries about: `APIs <http://ericholscher.com/blog/2009/nov/11/large-problems-django-mostly-solved-rest-api/>`_, `Search <http://ericholscher.com/blog/2009/nov/2/large-problems-django-mostly-solved/>`_, and `Database Migrations <http://ericholscher.com/blog/2009/nov/6/large-problems-database-migrations/>`_]*
A couple things I want to talk about. First of all, I will be participating in project52; which is a competetion to write a blog post in every week of the year. The last 2 years I have done the november post-a-day, and gotten about 25 of the 30 required posts. So hopefully writing twice that number of posts in 12 times the amount of time will be easy, right? Anyways, this is the first post in that series, so stay tuned for more regular and hopefully useful content :)
With Kong, I have been trying to figure out a way to provide
overridden model defaults. At work, our pythonpath’s default to
/home/code, however your setup is probably different. It would
be useful if there was a simple way to let you override the
defaults for your Kong installation.
When working on side projects, usually you wear all of the hats. Sysadmin, developer, designer, marketing, etc. You have to do all of them, and presumably you do one or two of them well, and the others well enough to get by. Working at the Journal World has been the first time that I have worked with real designers, and it has been a learning experience.
On Monday at work, our sites started to slow to a crawl. We looked to diagnose the problem, and found that the database server had a load of 10, and was struggling to keep up with the morning rush of traffic. After EXPLAINing the slow queries from the slow query log, we noticed that a lot of sequence scans were happening. This shouldn’t be happening because these queries should have indexes on them. We realized somewhere in the porting process that we had lost a bunch of indexes.
At work we have to manage a ton of Django based sites. Just for our World Company sites, we have over 50 different settings files, and this doesn’t take into account the sites that we host for other clients. At this size it becomes basically impossible to test each site in a browser when you push things to production. To solve this problem I have written a very basic server description tool. This allows you to describe sites (settings file, python path, url, etc.) and servers.
At most open source conferences, a lot of attention is given to the talks. At the ones that I have been to (Djangocon and Pycon), the most fun that I have had, and the most I have learned is during the sprints. I want to talk about the value and importance of staying for the sprints at a conference.
As part of the summer of code 2009, Django test coverage has been developed. I mentored Kevin Kusabik, who developed the code. It is hopefully going to be merged in 1.2, but there are still a few issues to be worked out in the implementation. That said, it currently works, and provides a nice introspective view of your code. This post will tell you how to run coverage on your code base.
When I was about to graduate from college, I was often asked what I would be doing with the rest of my life. This is a usual question that is asked of graduates and I have very rarely heard it answered to satisfaction. Upon being asked this for the 42nd time, I decided on my response..”Something Awesome”
Updated at the bottom of the post.
At work, a lot of our sites have sweet mobile versions. The problem is how to educate people of their existence. Currently we just have little ads that show up on the site that promote the mobile site, which seems a subpar solution. So I was tasked with doing providing a way to redirect to the mobile sites. Luckily, as a lot of the time with Django, most of my work was done for me.
Continuing in the series of big problems that are mostly solved, we have database migrations. A couple days ago I talked about Search.
Python packaging has been in a bit of a state of disarray for as long as I’ve been using it. Pip has come along to make installing python packages easier. It has a lot of features that are useful, but they have been talked about in many other blog posts.
In my previous post about template tags, I discussed the two steps required for template tags. Today I will be focusing on Parsing of template tags, and how they may be improved in the framework of Class Based Template Tags from yesterday. I have talked about problems with template parsing in the past as well. This post will offer 2 different approaches to making parsing better.
In Django, template tags currently are separated between a Node class and a “parsing function”. The parsing function takes the tag, represented as a string, parses the input, and passes the correct arguments to a Node class. The Node class then does whatever rendering it does, or updating of the context, and then renders itself in a form suitable for the template.
It’s been a little over a year since I started doing Django development full-time, for one of them real jobs. Around that time, there were a few large problems in the community that hadn’t been solved yet. They were kind of blemishes when you would talk to people about Django, and I’m happy that most of them have been solved.
At LPDN, our weekly programmer drinkup, we have been talking for a while about watching the SICP lectures from MIT as a fun thing to do. I then got to thinking about how it would be neat to involve more than just the few of us in Lawrence. Everything is more fun on a larger scale, and having compatriots makes you more likely to finish it. Somewhere along the lines of the Infinite Summer, I was thinking about having some kind of Hacker Book Club.
Continuing on with the simple tricks that make everyone’s life a little bit better, I know a lot of people hate that Django’s 500 pages don’t get rendered as a RequestContext. This means that if you have context processors (like one that sets a MEDIA_URL), they don’t get called. This was causing our 500 pages not only to make users sad because something broke, but knock them out of context becaue our entire design blew up.
There are the slides to my Token Testing Talk from Djangocon. I’m hoping the videos will be posted soon, but I think that it went well. There were a lot of good questions, and I need to put some recap posts up, but for now here is a copy of the slides. PDF
In a previous post I talked about a neat middleware to debug production environments in Django. It basically checked to see if you were a superuser, or if you were in settings.INTERNAL_IPS, and if so, then it displayed a technical 500 page for you (The yellow one you know and love). Anyway, at that point it was more of a simple idea, and not really used in production.
Setuptools comes with a way to
run the tests on your application.
This allows the user of your software to download it, and run
python setup.py test and check to see if the tests in your
application pass. This is really useful for distribution, because
the user doesn’t need to know or care how to run your tests (nose,
django, unittest, py.test, or whatever else), and can simply see if
Migrating test fixtures is one of the biggest pains of testing. If you create your tests too early, then change your schema, you have to go back and touch all your old test fixtures. This discourages people from writing tests until their app is relatively ‘stable’. As we all know, this may never happen :) This solves half of the problem, the part where you have to manually change a bunch of fixtures to reflect changes in your schema or data.
Any sufficiently large Django project starts to have a wide variety of Template Tags and Filters. Even Django ships with a dizzying array of them that allow you to do all sorts of fun and interesting things. Ellington, our CMS at work, has a ton, and I’ve been thinking about ways to make tags and filters a bit more accessible to people who are using the CMS.
Just got off the stage at EuroDjangocon, which was my first real talk in front of the Django Community. I hope that people enjoyed it, and that it was informational. Here are the slides to my talk in PDF Form, and on slideshare.
Today is the day that Google has announced the accepted projects for the Summer of Code. Django has 6 spots this year, with a bunch of exciting projects. I am lucky enough to be mentoring Kevin Kubasik with his project “Upgrade the Awesomness Quotient of the Django Test Utils and Regression Suite”. I’m really excited for the opportunity to help improve Django by overseeing Windmill testing of the admin, and lots of other small testing improvements that will hopefully make it into trunk.
A lot of the Django code we use at work has a special case for AJAX. It has been a kind of a pain to test, because the test client by default doesn’t use AJAX. Luckily the is_ajax call in the Django HttpRequest object is a simple check of an HTTP Environmental variable.
SSH Tunneling has become an invaluable tool that I probably use more than I should. I love tunneling, and use it all the time. This will be a quick tutorial on how to use the SOCKS proxy ability of SSH to allow you to tunnel your HTTP traffic through a remote server.
I keep hearing people talking about how twitter is going to be over run with spam now that it is becoming mainstream. I really don’t understand this viewpoint, and will take time here to outline what they could be talking about, and what can be done.
It’s that time of year again, and the Google Summer of Code is happening again. This year Django will be applying again, and there is currently a Wiki page on the Django wiki devoted to ideas and people who want to volunteer to help mentor. I think this is a great opportunity for students, mentors, and the projects involved. It is a really neat learning experience. Even if you can’t participate, it’s a good chance to put ideas up that some enterprising student might pick up and run with.
The ice is starting to thaw and I’m making my way out from under my first winter in Kansas. You know that spring is coming because the conference season is starting to bloom. I’m looking forward to a bunch of conferences that will be upcoming in the new few months. I’ll be attending two of them, and hope to see lots of interesting people there!
Lately I’ve been delving into Django development a bit more, and applying people’s patches has been a bit of a hassle. You know you want to apply someones patch, but there are about five steps in between you and applying their patch to your source tree.
So at work we have a lot of different django environments, scattered across varies servers. All of this information is kept in a central resource. We have the pythonpath, settings file, and the remote server that the client is on. So every time that I want to go do work on a different site, I have to ssh into that server, set the PYTHONPATH and DJANGO_SETTINGS_MODULE environmental variable, and then do what I want to do. This is not a huge deal, but it is annoying when you’re doing it 10-20 times a day.
Just a quick warning/tip on using Django with rsync, for other people pulling their hair out later.
So about a month ago I started a project on my blog called the Django Conventions Project. It was an attempt to document and record conventions that are used across the community. Conventions are a great thing, with Python and Django relying on them a great deal. Things like private methods being underscored aren’t enforced on a language level, but are more of a gentleman’s agreement.
So today I would like to tell a story that really shows why the internet is an amazing thing. This month’s articles on A List Apart focused on web education for universities and I’d like to share a story about one way to empower students and show them the power of the internet. Teaching people to create for the internet is a great goal, but teaching people the power of the internet by example is something amazing as well. It is hard to motivate people to create things on the internet without the understanding of how that has value.
5 second review: Reading this book will make you a much better Django Programmer.
As of Changeset 9756, Django’s test suite is A HELL OF A LOT FASTER. This was one of the 1.1 Features and probably the one I was looking forward to the most. Django Unit Tests now run inside of a transaction.
Well it’s been a crazy roller coaster year for me. So this post is going to be the typical recap of what’s gone on with my life and my blog over the past year. I’m really happy with where I’m at both professionally and personally, and 2008 has been an interesting year for me.
During the last month I have proposed some conventions for Django, mostly in the realm of templates. In doing so I have looked around for other documented places where conventions are mentioned. I haven’t found a really good reference for Django conventions. Brian’s post was a good example of reusable app conventions, and the Pinax Project is a great reference implementation. However, I couldn’t find any simple reference for regularly used conventions in the Django world.
It’s the end of the Post a day for a month. I did pretty well, but fell off about 3 weeks in because of work. First some stats.
A couple posts ago, I talked about how we should have conventions for the names that we use in Django Template Blocks. Today I will be talking about the value that is gained from this kind of structure.
About a week ago, I went ahead and re-wrote testmaker and moved it into my django-test-utils project on github. The syntax is now a bit different, and the whole thing is much improved. This is version 0.2. The `screencast <>`_ from the last release still shows the gist of the project, except for the changed syntax.
I have been doing some more work on my Django Community Aggregator / Django People v2 project. A big feature that I want to incorporate is tagging. I want people to be able to sort data by tag, among other things. I think that this is a pretty killer feature.
Note: This isn’t a technical post. If you don’t want to be getting posts like this, you can sign up for just my Django feed. This is my personal blog, so stuff like this pops up from time to time :).
There are a lot of reusable apps out in the Django Ecosystem. I wrote a previous post about why I think that reusable apps should come with templates. There is a problem about distributing templates that I want to address with this post: the problem of Django Template Block names.
So at work since I started for Mediaphormedia, currently World Online, and the birthplace of Django, I have been tasked with porting Ellington. Ellington is the CMS that we create and sell, and is what Django originally was. Django was pulled out of Ellington and Open Sourced.
Well I spent all day Saturday, and all night. Into Sunday morning hacking on some code. Probably the most productive 24 hours of my life. I have a couple of announcements, but in the spirit of post-a-day, I’ll spread them out over a couple days :).
Nick had a nice post about setting DEBUG based on the hostname of the server that you’re site is running on. This allows you to set DEBUG to True for your staging site, and False for your production site.
There is a debate among the Django community about whether people should include templates in their reusable apps.
I was having a conversation with Jacob tonight about testing in Django. He has shot down testmaker for being too specific for Django core, which I almost agree with, given my grandiose plans for it before the month is out. I’m quite okay with it staying a third party app for a little while longer.
A lot of the time I start a blog post as a sentence. It is something that strikes me and I don’t really know what I think about it. It is a moment of thought that needs to be revisited, but cannot yet be expounded upon.
This is the fourth in a series of Django testing posts. Check out the others in my Testing series if you want to read more. Today is the start of a sub-series, which is practical examples. This series will be going through each of the different kinds of tests in Django, and showing how to do them. I will also try to point out what you want to be doing to make sure you’re getting good code coverage and following best practices.
Today I’m going to be releasing a new project, called django-test-utils. It’s rather empty at the moment, but it does have one cool feature. That is my Django Crawler. I have some big plans for this little guy, but for the moment it has enough functionality to make it pretty useful.
A couple posts back, I was talking about software that I use all the time. I was going through and linking to all of the software. I would go to google, type in the project name, go to the first result, and copy that URL back into my post. I figured that there had to be a better way. Any software project worth it’s name owns the top result in google.
There are a lot of things that I love about Django. Template tags are one of them. However, they do have a couple of warts that bother me. I know that there’s a problem when I actively look for another way to accomplish something instead of writing a template tag. I view them as a kind of last resort; thinking ‘can’t we accomplish this with a Manager instead’? I think that we need to work on making useful template tags a little bit easier to make. Django goes a long way in doing this with the simple_tag and inclusion_tag types of tags. However, I think there needs to be something more.
Stealing an idea/meme from Mark Pilgrim I’m going to do a post of the essential software that I use in a day to day basis. Justin also did a similar post a couple days back. I think it is interesting to talk about what kind of tools you use, because it gives people an understanding into how you work, and also some pointers at stuff that maybe they too should be using.
My workload at work is about to get a lot less critical and time consuming, so I was looking for a project to start on. I am really interested in the social aspects of the web, and below I will outline an idea that I think will be my next project.
In the first two posts of this series, we
talked about how to get the basic infrastructure for your tests up
and running. You should have a file with doc tests and one with
unit tests. They should be linked into your django project with an
__init__.py file. If you were feeling adverterous you may have
even added some real content to them. Today we’re going to start
going down the road of getting some data into your tests.
Last post we talked about how to set up and use doc tests inside of Django. Today, in the second post of the series, we’ll be talking about how to use the other testing framework that comes with Python, unittest. unittest is a xUnit type of testing system (JUnit from the java world is another example) implemented in Python. It is a much more robust solution for testing than Doc tests, and allows for a lot more organization of code. We’ll get into that in the next post in the series, comparing Unit and Doc tests.
I just pushed my new site design live. My last post got lots of hits and I was tired of the comments about how horrible the site looks :). Please let me know what you think. There are still a couple rough edges, but I think overall it is a lot better!
Note: I’m launching a redesign today to address the styling issues. Please bear with me
This is the first in a series of blog posts and screencasts that will walk you through how to test your Django application. These posts will focus more on how to get things done in Django, but note that a lot of the content is applicable to pure python as well. A lot of best practices are codified into Django’s testing framework, so that we don’t have to worry about them! I will try to point them out as we are using them through, because they are good things to know.
November blog posting month has a special moment in my Django history. It was this time last year that I really got serious into Django. With the help of James Bennett’s and Marty Alchin’s blog post a month streak, I got an incredibly valuable insight into Django. It showed me a lot of the power and other great things about Django (especially the community).
We were talking about things that we wish we had known before while developing for Django the other day in IRC. I proclaimed that we should write them down somewhere. So I’m writing a post to get this effort started. Please feel free to leave comments with your own tips and tricks, and I’ll compile them in some kind of good fashion. These are mostly just pointers, and not full-blown writeups, just more of a big list of stuff you should think about. I think these tips will really help out new people when they’re trying to get the hang of Django.
I went ahead today and figured that I would try out Pinax, seeing as it’s been getting a lot of good press in the Django community lately. The talk from James Tauber at Djangocon was really good, and I certainly recommend checking it out. This is going to be a basic introduction to pinax.
This is a screencast on the Django Command Extensions project. It is one of my favorite third party apps, and it gets installed in every Django environment I work in. It provides a plethora of useful manage.py commands, and a couple other little goodies as well.
Today’s screencast is about pdb again. This time we are going to be debugging management commands, and unit tests for django. This is a little bit more powerful than the previous screencast which just introduced the basic debugging commands.
I had a couple of comments about my last post saying that I should be sending all of the screencasts to the aggregator because this is content and isn’t spam. So I’m going to do that. Thanks for all the feedback everyone! Hope you’re enjoying the series.
This is the second screencast of a week long series.
This is part 1 of a week long series of screencasts
Today I ran into a fun problem when writing template tags at work. (I’ll write another post later on the fun-ness that is testing of template tags :) In ellington we have some templatetags that test for the current time of day. ifmorning, ifnight and so on. These template tags are using datetime.datetime.now() to check to see if the time is within a certain range. This is impossible to test in a standard way without doing some hacking on the datetime.datetime object.
First off let me say that I know that not everyone likes setuptools and that is fine. distutils works well and is included with python. However, I believe that Python needs to get some parity with what Perl has with CPAN. Pypi is Python’s alternative, so tools that integrate with it are good.
Okay, Well I have been hacking away at django-testmaker for the last couple of days based on some ideas from the community. It has gotten a lot better, so here is another blog post showing what’s new.
At work lately we’ve been writing a bunch of tests for all of the work we’ve been doing. This is generally a good thing (tm). I was getting tired of manually having to write all of the code to test the views inside of my app. So I decide to write a little app that helps me automate the writing of tests.
Heard from Robert Lofthouse on Twitter. The Djangocon 2008 conference will be held at Google Campus (Googleplex) in Mountain View!! September 6 and 7th. That’s only two months away, so hopefully this gets pulled together well.
I was just convinced to setup mod_wsgi on my server instead of mod_python, and I’m going to write up how I did it. All of the documentation I found on the internet was really hard to follow, so I’m going to distill it here the best that I can.
It is being kinda announced about DjangoCon 2008! It is going to be in the Bay Area and sometime around the release of Django 1.0 in September. I heard about it a couple days ago from Jacob at the office (because I work at Mediaphormedia, birthplace of Django). I’m really excited about it, and I’m thinking about heading out for it. I have never been to the Bay Area. We’ll see how it pans out when it gets announced, but I’m almost definitely going! YAY!!
I’m currently reading Malcolm Gladwell’s Tipping Point, and it is an amazing book. One thing that he mentions is that the Muppets were actually used by Jim Henson before Sesame Street to do advertising! I never knew this, and find it fascinating. There are a bunch on youtube that some posted. Great stuff!
This is a video from Gardner Campbell, one of the best professors ever, English Professor at the University of Mary Washington.
Loving Lawrence still. I haven’t had to fill up my gas tank since I’ve been in town. My car probably hasn’t moved in about 3 days. I have established a pretty good schedule, and I have been living really well.
My house just got a bear head. It is about 2.5 feet fall, and real. It came from a museum. My house rules.
I just got around to updating my profiles and online stuffs (Graduating, Moving, and getting a new job will do that!). I just updated my “about me” section, and threw in some things that I say way too often (My friends can vouch for this). Anyway, I think they say a lot about me (and are said a lot by me)...
Eek! The job starts Monday! That is like, 36 hours from now. I’m really excited and slightly nervous. The excited feeling comes from the place I’ll be working. For posterities sake, here is the series of interactions that landed me the job:
FRICKIN SWEET. What a cool town. Couple random things made my day today.
Hey all, anyone who is getting this content on an RSS reader, if you could please update your links to point at http://feeds.feedburner.com/EricsThoughts . I’m starting to use feedburner, and i can change that to where ever i’ll be blogging, so that’s the last RSS url you’ll need for me. :) Thanks!
Hey world, how goes? This is part 1 of 3 in my whirlwind trip around the East coast. This is the trip to Boston, Part 2 is the trip around Virginia, and Part 3 is Maryland. Here goes nothing!
I feel that I am most able to convey my ideas and gain new ones through conversation. Viewing a blog as a conversation is interesting, but I have yet to gain the same value through a blog as a good conversation in real life. I feel like I ask good questions, and have a skill in the ability to conduct conversation well. I feel that this is a good skill, and not something that needs to be changed. I guess the new skill that needs to be learned is how to make online ‘conversations’ more like the real life ones described above.
Three days until graduation. I’m getting really excited. Getting all of my stuff in order to go out to Kansas, and enjoying the rest of my summer. I’ll start posting more frequently soon hopefully, since I’ll have lots of free time, and need to be getting into programming mode for my job. Super super super excited about life right now!!!
Watched Dead Poets Society about 3 times in the last 2 weeks, and was inspired in the ways of rhyme and rhythm. Here’s a poem, loosely based on one of my favorite quotes..”The more you know, the more you know you don’t know”..
There are some really cool ideas floating around the interwebs these days, dealing with discovery of authentication. A lot of the talk is about integrating OpenID into the browser, but I don’t think it needs to be limited to that. People are working on good ways to auto-discover what the login end-points are on some pages. So when I go to ericholscher.com, there will be a specific URL to go to that will list the places where you can login, and what they support. For example: /authEnds.xml would say that /account/login/ is the endpoint of login on my site.
I am just starting to use Gnome Do, and it’s amazing. You hit (windows key) + space, and it pops up a little window where you give it commands. It tries to figure out what you mean when you type a certain combination of words, and remembers what you usually do on those combos, and does that in the future.
Only have 2 weeks left until presenting at NCUR. I give my honors project presentation to the UMW Compsci faculty on the Wednesday before the conference. Lots of work to do, but enjoying it. Getting to really dig into Django and learn it and understand it’s modularity is awesome. I’m super busy and it feels like real life is starting...Should be a fun endless summer.
Had an interesting conversation with my roomate Mike last night. It helped me clarify something I have always understood, but never found a good way to say. This is probably going to be another failed attempt, but here goes.
Here in computer science land, the quest is for the perfect abstraction. That’s what our job is anyway, Software Engineer my ass, more like lead abstraction implementer. This quest for the perfect abstraction is never-ending, and certainly cannot be attained by humans. We aren’t capable of creating bug-free software, so our abstractions will be inherently leaky. If it wasn’t leaky, then it wouldn’t be abstracted.
This is an amazing video of some dynamic 3d work a guy did for his PhD Thesis. Johnny Lee is a PhD student at CMU, and he modified a display to use the wiimote and a special headset to give real 3D effects. It actually changes the picture on the screen based on your proximity and angle to the screen. Amazing.
I plan to design the events site through the lense of the user. The UI philosophy is thought about in that way. We don’t ask how to design a page about adding an event to the calendar. We ask what the user wants to do when putting something on the calendar. What are the use cases of the calendar, why is the user there. This ties in with what makes our cal better than other cals. Trying to make the UI amazing.
Simple example. I walked into my room today to a picture screensaver which is awesome. Aparently it uses the Pictures folder on the Desktop, of which only my latest pictures are in. I want it to use all of them...
Starting the good ol’ job hunt. Trying to figure out what I’m going to be doing with myself for the next couple years of my life. Big ol’ decision that it is.
I was reading an article on LWN about security vulnerabilities on newly shipped machines. The qualm is that the same place that the updates for vulnerabilities come from is the same place where you are going to get infected. They are asking if there isn’t possibly a better way to do it. I think there is:
Saw Bill Clinton speak on campus today. It was awesome! He is such a great public speaker. It’s amazing to hear a politician say logical things, backed up with numbers, and actually agree with their general ideas. What a concept. He hasn’t made me want to vote for Hilary Clinton over Obama (certainly the point), but if she does win over Obama, I will feel genuinely better about voting for her in the national election. Bill is an amazing speaker, and was funny and serious at the correct times. Very well done. It lasted over an hour, and the turnout was amazing. There was a line halfway down our entire campus! Very cool.
I got accepted into NCUR. The National Conference on Undergraduate Research. Here is my abstract. I get to have at least the abstract published, and maybe the entire paper that I write in support of my project, still not sure how it works. UMW is paying for me to go, which is amazing. It should be an awesome opportunity to meet some people in my field doing interesting things. The presentation there is the weekend after my Honors Project presentation that I have to do to graduate with honors. The timing works out well :)
This is a really cool Ford ad. I’m glad companies are starting to understand that commericals are content too. If you make them worth watching, they will get spread and your message will be heard a lot more places. Somebody has been listening to Seth Godin :)
I’ve always been a fan of those ads where one things leads to another to another without intervention. I’m sure there’s a name for it, but you know what i’m talking about. Just found this neat one online from a dutch website, which is simply awesome!
At work this week I’ve been tasked with using PL/SQL (Oracles version of SQL scripting) to create traverse a tree structure stored in a database. The data is stored in a simple tree, with each node having an id, and a parent_id. When the parent_id is null, then that means it is a root node. This structure will be used to display navigational links for pages in an automatic fashion.
I’m really excited that Obama “won” Super Tuesday. He got more states and more votes, and has been declared the winner, even though Hilary is only like 5 votes behind. I’m glad that Virginia is actually important this primary season, and I think this is the first time I will ever vote. I have never had a good reason to vote before, but Obama is such an inspiration. As is almost cliche these days, he is actually inspiring me to get out and vote! That is no small undertaking, and I believe a large part of how he is doing so well. Young people aren’t apathetic, all previous candidates have just been God Awful.
Okay people. Here’s a proposal for you. Let’s change this school of ours. For my Senior project at UMW I’m creating an “Events” calendar for the school and fredericksburg community, if you’re interested in that, read below.
Was talking to an old friend today. My friend Shane who graduate from Georgia Tech with a degree in Electrical Engineering. He’s currently in Cali, with a cool job somewhat related to his major. I was talking to him about the current situation (graduation approaches),and he has an amazingly apt drawing.
OCR should use context, when it sees the word ‘everythxxg’, it should know that the ‘xx’ is ‘in’. This is how the human brain works, and is how the computer should work too. If Google can suggest spelling suggestions to my misspelled words, there is no reason that this technology couldn’t be applied to OCR. It would make it much more powerful and useful.
For most of my life my dad has been my wikipedia. Long before it existed, anything I had a question about, I could ask him and be assured to either be given an insightful answer, or a logically thought out answer that amazingly always seemed to be correct. I think this is the basis for the constant curiosity that still exists in myself.
Lost the weekend and this week in web land. A friend came to visit, everyone came back from break, and classes are starting. I will begin posting regularly again. I read 3 books in the last 2 weeks, which I posted about earlier. On Intelligence is amazing and has set my mind racing, expect some good posts coming up in the next week or two based off of reflection on that.
Just finished reading Hackers and Painters by Paul Graham. It was an amazing book about the past, present, and future of computers. Lots of stuff about programming, but also fulfilling for people that don’t know much about computers as well looking outside in. It explains a lot and is an amazing read. Paul Graham is an amazing Essayist and it shines through in this book. It contains 15 unrelated essays, and is highly recommended.
A picture is worth a thousand (horribly said) words :)
Just posting some books that I want to read this upcoming semester.
The code for the website is now located on launchpad. I am using their bazaar version control system that is kick ass. It’s a Distributed VCS which means that you can run it completely locally, without a server. I use the server of course, but it allows you to do work on your code without internet access and other neat things.
Never heard of a band called Battle before. They have a really neat video that I got pointed to from a really cool advertising blog
This is why OpenID is such a good idea.
An interesting opinion piece that I read at work in the NY Times today. Talks about how Obama and Huckabee both embody vastly different philosophies of government than the previous established order. It gives me hope to hear them discribed that way. Hopefully the existing governmental structures won’t sink their hopes and dreams for this once-great country of ours. Two Earthquakes
Funny, Scoble just got banned from facebook for doing exactly what I was talking about doing. Damned social information silos..
I’m thinking about how to implement facebook’s social graph in my Events calendar application. It would be a big boon for my site if when people signed up, they could automatically have their facebook friends imported as their friends on my site. However, I don’t like the idea of having to have the person give me their login information to do this. (This is what OAuth is for!).
Tomorrow is the Democratic caucus in Iowa. I’m really hoping that Obama wins, or basically anyone but Clinton. I believe that Edwards and Obama have the best chance of actually returning this country to it’s basic morals and values, and I certainly plan to vote for whichever of them wins this primary. I also believe that if Clinton wins, then it will be the first time in history that an independant could possibly win the White House. (Obama/Edwards, or Obama/Paul perhaps?). Here’s hoping that faith and morality wins out in this crazy world of ours, and a chance to put America back in it’s rightful place as a law-abiding and moral country.
Just found that there is lots of awesome college content on iTunes. Standford U has some awesome stuff, I recommend watching Steve Jobs 2005 Commencement speech. Inspiring.
EDIT: Hey everyone, I wrote an updated post that actually tells how to setup a django app (and any python app) using easy install. Check it out!
My first four browser tabs have been the same for the past couple hours. The first is the root of all evils, and the other three are productive!
I know you loved Lego’s as a kid. I wasn’t hugely into them, but this site makes me wish I was.
Just started reading a book by the guys over at 37signals. It looks amazing. Completely free online. I’ll get back with a review once I’m done, and hopefully with a finished website as well :)
Having this project to work on gives me more ideas. The ideas have context. Context makes them more valuable than abstract ideas that they once were. My context allows others to relate my ideas to their context easier than abstract ideas. Nice abstract idea isn’t it? :)
Wordpress you were good to me. I’m going to migrate all my posts over to a new Django blogging app I’m writing. Part of my website for the Event Calendar and learning Django Done soonish hopefully
Implemented Background processes, the ps command, and the kill command in GeekOS today for my Operating System class (hard shit!). Really neat stuff though.
Registered for classes today, pretty excited about my schedule. My last semester senior year isn’t going to be a cake walk like it should be (because i’m lazy), but it’s going to be much better than this one. Taking the second part of my Physics lab (required) and 2 PE classes, tennis and weight training, fulfilling all of my required classes for the school. I’m going to be continuing my senior Independent Study Project, for another 3 credits. I’ll be taking a 300-level CS database class to round out my Compsci Education. I will then also either be taking discrete math or intro to film studies, pass/fail. If discrete doesn’t look like it’ll be too much work i’ll take them, if not i’ll do film studies and coast.
The story starts out unusually. One of my friends is trying to write a very important letter to a family member. He doesn’t know how to write it. He has the outline, but is very worried about the implied psychological impact. They worry about the reader thinking too much; “was he trying to be so nice and just said all nice things”, or on the inverse “Wow, how hateful, full of hate he must have been”…We brainstorm the answer to the question which will seem obvious.
The Internet Archive is one of the neatest sites on the internet. I like them for a variety of reasons. First and foremost is the live music archive, they currently have 44,134 live concerts posted on their website. Completely free to download/stream til your hearts content. Most of the bands I like these days are on there, and they have an extensive Grateful Dead collection.
It’s almost daylight savings time, this weekend. That makes me sad, I hate it getting dark at 5pm. It will make work much more manageable though. My current schedule is working 2-8 Monday’s and Wednesdays. I adopted this schedule to make sure that I actually got some hours over the school year. 12/hr work weeks aren’t too bad, but it is pretty hard with my hardest ever semester of school.
Basically just a knowledge dump of The firefox extensions I use and where to get them for future reference.
A lot of websites have those annoying ‘digg this’ buttons, with 0 diggs on it. How silly that makes them look. I feel like an idiot reading a web page that nobody else cares about...
I hope to write atleast one post a day, saying what I learned from that day. Mostly like a journal, and not super interesting to most people. I feel like this will help me improve my writing and give me content to write about. (I hope my days aren’t so boring that the old adage doesn’t apply)
This neat little program lets you use your network as a KVM. You set up a ‘server’ computer where you use the mouse and keyboard, and then ‘client’ computers on the right of left of your server, and when you go off the screen of the server, it automagically goes to control the mouse and KB of the client machine. Really neat.
It’s amazing the difference having one person in your life can make or break your entire existence. Usually this would apply to a significant other, but a best friend is just as valuable if not more. Went to JMU for less than 24 hours with a good friend from school; to meet my best friend since second grade. We all got along marvelously and it was one of the best nights i’ve had in a long while. My spirits are high, I feel motivated, and my faith in humanity has once again been restored.
We had a little jam session at my house over the past weekend. My roomate Tessie recorded it and here is a link to the mp3: http://ericholscher.com/music/us.mp3 Hope you enjoy it, its lots of drums, a theramin, and a bass.
I’m starting to update my website, moving everything from .shtml over to cgi’s because it’s easier. Also building out my web-based lyrics script to include saying lyrics are bad or good. Also trying to figure out a good way to automatically get all of the lyrics from an artist whenever one is found. Then run this in the background and they will be in the database cached when requested.
Apple just released the iPhone today. This looks like a paradigm shift in the world of mobile phones. It’s amazing how much a company can innovate when it doesn’t have it’s own silly motives to protect. Most other companies have ‘walled gardens’ or their own internet that they are trying to make money off of, so they don’t offer Wifi access. It runs OS X, how long until this thing gets VoIP compatibility? They are Partnering with Cingular, so they may nix that idea, but it has to be on everyone’s minds. The iPhone looks damned impressive, and if you go to their site you can see the amazing prototype.
I just installed Songbird which is a really neat music player built on top of XUL (of firefox fame). It’s cross platform (yey good Linux support) and is currently only a developer release. It’s working great for me and I’m excited about the possibilities. One pet peeve is that it didn’t have a systray icon for it, one feature that i’ve grown accustomed to. Browsing their forms someone pointed to Alltray, which allows you to launch a program “alltray program”, and it will automatically create a systray icon for it. COOL! How have I not heard of this before?