Skip navigation

I just read Joshua Jonah’s post about Limiting HTTP requests with Django.  The gist is that he’s starting to get worried about all the different <link rel='stylesheet'>‘s and <script src='/some/js'>‘s in his document <head>, and we all know that each of those generates a separate HTTP request which will slow down your page’s load time.

My technique uses a view that builds a JS/CSS file with Django. The CSS/JS files that are compiled like this should be stored in your templates directory instead of your static media folder so they are accessible to the view…

…This allows you to used [sic] Django template language in your CSS files.

And I had an ah-HA! moment.  Could this be the way to use variables in your CSS files?  Having a view that defines a bunch of colors:

def buildcss(request):
…snip…
linkColor = ‘#999’
linkHoverColor = ‘blue’

and passing that into the template that generates your CSS

a {
color: {{ linkColor }};
}

a:hover {
color: {{ linkHoverColor }};
}

Now, you probably don’t want have Django performing doing this kind of work for every request, so you might want to cache the URL that generates your CSS.  And I’m not sure if there are other downsides to this I haven’t considered, but it’s interesting to think about.

Advertisements

I ran across this link at reddit, and finally decided to install google’s chrome browser. I’d heard all about how Chrome handled javascript so much better than anyone else, and balldroppings was the first site I ran across that actually made me want to try it out.  Suffice to say, chrome handled the load WAYY better than Firefox.

find . -exec grep -l "search term" {} \;

My boss showed me this nifty little one-liner a while ago.  I thought I’d better post it before it dissapeared off my white board.

Was installing Django on a webserver recently, and something bit me.  I kept getting the following error:


MOD_PYTHON ERROR
...snip a whole buncha stuff...
ImportError: No module named django.core.handlers.modpython

I’d installed Django into my home directory, but the user that the webserver runs as didn’t have read access to that location.  Problem was solved by putting Django into a place where apache could get at it.

So, I started this new job in July which affords me the opportunity to ride the bus to work instead of driving. The new office pays for the bus pass, so all I’m out is the little more time than driving would take. I decided that the ride would be an excellent opportunity to work on the secret project screenplay, and so far I’m right. As long as there’s a place to sit, I’ve been able to come up with some great new ideas and expand them into scenes, all during my commute.

But I realized before the holidays that it’d been a while since I’d really sat down and looked at the screenplay as a whole.

It’s bad.

Really bad. I like the direction things are going generally, but its amazing what a little break from your work will surface. Problems abound. Continuity problems, lousy character introductions, plot holes. That sort of thing.

See, the thing is, in the last few months I’ve been reading screenplays, and listening to screenwriting specific podcasts. The Creative Sceenwriting Magazine podcast (iTunes link, highly recommended), and Pilar Allesandra’s On The Page (iTunes link) podcast. Of course, John August’s blog is a must read. A trip through his archives is definitely worth your while. These sorts of helps are what make the internet so great. You can learn on your own time at your own pace.

And I’ve learned that a lot of what I’ve already written is pretty bad. Which is OK. I’m willing to work at it to get better. After taking the holidays to fix a lot of stuff, and add new stuff, I’m pretty happy. I’ve got 40 OK pages down, and they’re definitely going to get better.

Also, I started running numbers on making this movie and selling it online. For my projected budget (which, of course, is me just making numbers up, but still) I’d need around 20,000 people to pay $12 in order to break even. Odds are pretty small, but what’s encouraging, is that Internet distribution is possible for an independent. Things are looking up.