Installing Django on OSX Tiger 10.4 INTEL

Posted by Joel Jensen Sun, 18 Jun 2006 15:26:00 GMT

Here are some tips for installing django on OSX Tiger Intel

Inheritable templates for Ruby on Rails

Posted by Joel Jensen Sun, 04 Jun 2006 05:23:00 GMT

I have been giving thought to templates and template inheritance. I have used Zope and Plone for 5 years. I recently looked at Django for a few days and wrote a small test site. I liked the templating in both Django and Zope. Specificly the inheritance in the templates.

Let me explain, in Django say you have a basic look and feel for a whole site. This basic layout contains real html code for the site, the default text for blocks which are not overridden.

better said by the Django guys http://www.djangoproject.com/documentation/templates/

basic_template.html

  • title_block
  • content_block
  • footer_block
  • right_area_block

individual pages will then extend this template overriding the blocks they wish with blocks of the same name. For instance, a newspaper has a subsection with

  • special content goes in content_block
  • advertising and links about the article goes in right_area_block

the rest of the page remains the same as the basic_template.html, just the content block and the right area block are swapped out.

Django takes this pretty far with inheritance. A controller calls a template which specifies which template is being extended and so on and so on.

I have written 4 production sites for local businesses in Ruby on Rails. I have run into problems with rails “all your content goes in one spot” @content_for_layout approach to templating. I like to build sites with lots of blocks for stuff to go in and remembering which partial went where is a pain. Having a Django type of flexible inheritable layouts would make life much easier.

So I got to thinking how this could be done. I thought of the way that Django does it with definable blocks, this approach is the most pragmatic to build. However for use, I thought of overriding named <DIV id='foo'> tags. If a template has a named div tag that whose name appears in a parent template, that div overrides the parents.

This type of overriding wouldn’t work for non html content, but for most stuff I do it would be great.

I started looking for a XHTML parser for rails that could parse the compiled templates into DOM then merge the files letting the new nodes override the default ones, trouble is that this may create some extra compile overhead with multiple templates being worked on.

Right now this is just a tickle in the back of my head, but it may make for useful templating of Rails.

os X command line shortcuts

Posted by Joel Jensen Sun, 04 Jun 2006 05:13:00 GMT

Launch finder from command line

So I just found out if you type

open .

from any directory in the command line it will open that directory in the finder. This is pretty helpful

Rails Capistano Deployment

Posted by Joel Jensen Mon, 29 May 2006 23:05:00 GMT

I got Capistrano to work. Deployments now are a one line thing.

The issue I had was that the subversion repositroy I had used was http://localhost, this wont work since localhost in this context actually referrs to localhost of the remote machine that capistrano is ssh’d into.

I set up a external SVN repository and it was golden. Except for database migrations.

Capistrano will not execute commands on your local machine as far as I can tell.

Data Migrations in rails only migrate the schema changes, Yeah you can programmaticly add data via ruby. But this is a pain when you have a million rows of data.

I solved it by doing a mysqldump of the data, gzip it to save time, and use the capistrano “put” function to upload the data, then insert it into mysql on the server end.

Its not as clean as simply “rake deploy” but I can run 2 additional commands if I need.

2006.0 a spacecase oddesy 1

Posted by Joel Jensen Mon, 29 May 2006 14:33:00 GMT

I want to start using Capistano ( a deployment tool for ruby on rails ). Its pretty cool. It executes deployment commands on multiple servers in parallel over ssh.

It needs SVN to work. It says in the instructions that you cannot use file:/// repositories. So I thought hey why not use http://localhost. That brick wall dented my head.

REWARD FOR STOLEN SCOOTER

Posted by Joel Jensen Mon, 22 May 2006 05:29:00 GMT

$200 for info leading to return

Yep the scooter was ripped off.

Click here for info on the scooter

To reply add a comment and I will get a message.

To leave an email address click (leave url/email »)

Email addresses will not be displayed

Road Rash

Posted by Joel Jensen Mon, 22 May 2006 00:18:00 GMT

So I was out for a ride with a good friend John. We did one of the Rails to Trails routes here in Minnesota. There was a 10 mile long paved bike path past ponds, woods and rolling hills. I rode my recumbent Bike-E -W- Air suspension( for that boulevard ride ) It was comfey.

Riding along a country road when the trail ended towards a Victorian rivertown, Stillwater, I was getting hungry. There’s this really good ice cream store Browns, single scoops as big as your head. So here I am a hungry biker on a fast recumbent with one valley between me and Ice Cream.

I went REALLY fast down the hill into the valley, I swear I heard the Ice cream truck bell somewhere in the back of my mind. John is tucked in right behind me. At 40 the tiny front wheel of the Bike-E became REALLY unstable, oscillating side to side very fast, until I wiped out.

Uber road rash.

I really don’t remember much. John says it was spectacular. He was standing on his brakes to avoid me. I was sliding on the inside side of my new walking shoes. The new shoes SAVED my ankles, all the leather on the insides were gone, but very little skin. I sprained my knee, got a bad case of road rash, my bike shorts and T-shirt were shredded. The bike was OK.

The ambulance came, the medics gawked at my butt. “Thats a big rasberry there”, “Yep” and so on. They were really helpful and super quick getting there. If you are in need of rapid care, I recommend Stillwater.

All in all the ride was fun. The ice cream was well deserved.

A fleeting fleet of scooters

Posted by Joel Jensen Sun, 21 May 2006 03:39:00 GMT

So I bought the scooter just before Christmas, in pieces, untested, not running….

Over the last few weeks I have rebuilt it. Tuned it. De-restricted it for good speed. Its been operational for 3 days. Then it was stolen.

Bike thieves are the lowest form of scum.

So I spent the day giving flyers to all the gas station attendants within 5 miles, (16) stations, 2 laundromats, and zip plasma services (if you’ll sell your blood you might sell out your blood.)

I’m pretty sure I will get it back, they stole it nearly empty on gas so they have to fill up.

In researching this I found out that the are a I live in is 3 blocks from the highest theft area in St. Paul.

Scooters 1

Posted by Joel Jensen Tue, 16 May 2006 16:20:00 GMT

I bought a Aprilia Mojito 49.6cc scooter ( 50cc ) just before Christmas. It was a real deal, however it was also in 3 or 4 boxes. I bought it from someone who tried unsuccessfully to modify it. Well, I fixed it and is a blast to ride. I’ve had 6 motorcycles ranging from a 72 RD 350 to a GPz 1100 ( punched out to 1400 ). This scooter is by far the most fun. It also gives warm fuzzies to my inner cheapskate.

In Minnesota, insurance is not required on 50cc or less scooters, and 50cc scooters (but no larger) are allowed in bike racks in downtown Minneapolis. So basicly I got this nifty scooter, I like to ride, thats free to park, that doesn’t require insurance, and gets 65-70mpg. Cool.

Toes on the prarie.

Posted by Joel Jensen Mon, 15 May 2006 07:41:00 GMT

Years ago, after a 16 hour shift doing heavy labor. I was on the way home 80 miles away. Driving through the rolling hills of Minnesota in early Spring, grass green and Burr oak trees without leaves, my feet HURT, 16 hours on them and they will do that. I was drinking the last of my fork test coffee ( does a fork stand up in it ) looking at the trees, they were like the twisted endings of the nerves now pounding in my toes. I imagagined a Grant Wood landscape, rolling green hills and instead of burr oak trees, giant 80 foot high big toes.

Older posts: 1 ... 7 8 9