Twitter Updates
- git bloodbath -f 1 day ago
- I've said it before, but I'm going to say it again: I actually like Ke$ha. So there. Good pop music is good. 1 day ago
- @ehthayer I'm pretty good at copying someone else's designs and making them my own, but from scratch, it's really, really hard. 1 day ago
- I fucking suck ass at design. There, I said it. 2 days ago
- Scumbag 3G connection: Resamples JPEGs to lower Q, lets me stream YT and Pandora in full quality. 2 days ago
Blogroll
- 914 electric conversion blog
- ALL ART BURNS
- Arcade Zen
- Brian’s Gallery
- Chili’s World
- Chocomonkey’s Blog
- Follow me on Quora!
- Follow me on Twitter!
- Google Blog
- Juan’s website
- Julia y Daniel
- Katja’s Blog
- Kulick’s blog
- Paul’s Time Sink
- Peter S. Conrad
- Sad Salvation
- Slacy’s Gallery
- Snake Surley
- Sprang’s Blog
- Super Karate Monkey Fist
- Third Time Dad
- Universe Hacking
- Valspark
- Zac’s Story
- Zeigen, Inc.
Tag Archives: django
How to set session variables in Django unit tests.
This was super non-obvious, and I lifted code from a couple of different places. If you’ve got Django view code that gets & sets session values, you’ll want to test it properly, and the standard “self.client” from Django’s TestCase doesn’t … Continue reading
Django + PostgreSQL + virtualenv Development setup for Windows 7
Here’s what you need to do Django development on Windows 7. As I go through the install, I’m writing down all the steps to make sure that I don’t miss any. I’m going to focus on: Python 2.7.1 from python.org … Continue reading
Posted in General
Tagged django, installer, pip, postgresql, psycopg2, virtualenv, windows
2 Comments
Cleaner pattern for loops in Django templates?
I find myself typing stuff like this a lot: {% for item in list %} {% if forloop.first %}<ul>{% endif %} <li>{{ item.value }}</li> {% if forloop.last %}</ul>{% endif %} {% empty %} <p>No items in list.</p> {% endif %} … Continue reading
Both production & development settings using zc.buildout & djangorecipe
It took me a while to figure this out, so I’m writing it down. What I wanted was to have my django.wsgi script use the production settings and to have bin/django use the development settings. Sounds easy, right? It’s not … Continue reading
Posted in General
Tagged development, django, production, python, recipe, zc.buildout
Leave a comment
Django development setup on Windows
Django development on Windows sounds easy, but there are a bunch of steps to get it all working right. Python. Use Python 2.7 from python.org http://python.org/download/. I recommend avoiding the 3rd party Python distributions (ActiveState, Enthought, etc.) and sticking with … Continue reading
Posted in General
Tagged django, postgresql, python, setuptools, visual studio express, windows, zc.buildout
Leave a comment
Multi-dimensional dicts in Python & Django?
The code I’m working on frequently uses multi-dimensional dicts in Python. There is a bunch of code that seems to be always doing this: # a,b, and c have come from some external data source, QuerySet, etc. a = ‘axis_1′ … Continue reading
Announcing Parents Guild
Just a quick note to my readers and searchers that we’ve launched our new parenting website, Parents Guild. We’ve got question & answering, e-mail notifications, tagging, voting, and a bunch of other parenting-specific features in the works. We’ve got about … Continue reading
Resolving circular model imports caused by Haystack & Django
So, in converting our search to Haystack, I’ve found that some of my standalone maintainence scripts no longer work. They had an import error trying to import some of the models. The issue is that I’ve updated my models.py with … Continue reading
pprinting the Django context object
This was non-obvious to me for quite some time, and I tried several different approaches before settling on this one: If you would like to pprint your Django Context (or RequestContext) object from within a template itself, there are several … Continue reading
How to split views.py into a directory (Django, Python)
So, I’ve been doing some Django programming on the side, and the thing that annoys me is that Django forces you to put nearly all your source code into 2 files: models.py and views.py Being a reasonable person, I wanted … Continue reading