One of the big downfalls of storing bits of templates in your database is that you're limited to HTML/CSS/JavaScript. Individuals editing flatpages can't use template filters or other bits of Django's awesome templating language. Usually this doesn't make much sense, but for one CMS use-case (linking to other pages by identifier and not hard-coding their URL), it could make a big different. In that vein, Kyle Fox posted a comment on my post about django-chunks and mentioned that he had developed a template tag that allows individuals to insert Django templating language into Flatpages (and chunks!) This tag will let ...
Wow! I'm so excited about the news of an upcoming djangocon. Not only is it confirmed that it will eventually happen, it will be taking place in San Francisco, in September 2008! The date is engineered to coincide with Django 1.0's scheduled release.
By far, the one tip that's revolutionized my Django projects is this post by Rob Hudson, Django and Relativity: My default Django settings file has changed over time to now include settings that do not depend on the location of the project on the filesystem. This is great in a team environment where more than one person is working on the same project, or when deploying your project to a web server that likely has different paths to the project root directory. Nathan Ostgard wrote a post on how to use Django with Gmail and I come back to it ...
I just whipped together another really simple Django application I call django-google-analytics that simplifies the process of inserting Google Analytics tags into your Django projects. Why did I create this? I manage a lot of Django projects that present slightly-different forms to users depending on the site/domain they're visiting. There's also a bunch of custom submission code that differs from form to form, but that's neither here nor there. I need different Google Analytics codes depending on the sites and after sticking these tags into every single template, I thought it would be cool to be able to manage these ...
Here's another one that I've yanked out of a project. I call it RestrictMiddlware and it is a real simple, and really easily bypassed "security" mechanism. Like most security, it's just security theater, but some clients make it so hard to enable true security that you've got to resort to this type of stuff. As a warning, I'd really emphasize that you shouldn't ever use this type of access restriction on any site that contains truly secure, private, or sensitive material. Use strong user logins or better. This is the RestrictMiddleware and you just pop it into your Django settings.py ...
I've built an impressively simple and basic reusable Django application in the process of creating a mini-CMS for a client. It's called django-chunks and it's really nothing more than a model and a template tag. By adding chunks to your installed apps list in your Django project and performing a ./manage.py syncdb, you'll be able to add as many "keyed" bits of content chunks to your site. The idea here is that you can create a chunk of content, name it with a unique key (for example: home_page_left_bottom) and then you can call this content from a normal template. Why ...
I'm putting this out there because I can see there's a need for it. Disqus, which I mentioned in my previous post, has a couple of methods of integration. The method I chose, the quick and dirty route, is to insert a chunk of JavaScript in certain places on your blog that injects comment counts, a comment thread, and a comment box into your page. On the other side, is a great potential for true integration with your custom blog or site. Disqus has a fairly full featured API: All API methods accept their parameters in the query string of ...
I fixed a bug in my Google Reader feed processor that was making some of the stuff I shared through Google Reader lose the actual content (except for title and link). So if you follow my link blog through any of the RSS feeds on this site, you should start to notice that they're much cooler now ;) I also cleaned up the middle sidebar you see on the home page of the site by separating out Tweets, songs, and links into their own lists. So now I list the 5 most recent tweets, 5 most recent songs, and the ...
Here's a quick question to the Django people following my blog, and one I think will be a huge help to individuals attempting to perform something similar. I'm currently working on a project that could make use of Nathan Borror's excellent django-basic-places and django-basic-people applications. I'm loving them so far, and getting a lot done. However, one thing that I would like to do is allow for a Person to be associated as an "owner" of a place. If I were writing all of these as a cohesive application, I would add an ForeignKey field to the Place model and ...
I know the going is slow here. I've been doing a lot more nerd blogging over on our Stone Ward Interactive blog. So if you're into web development and other technical subjects, check it out!
DjangoPeople is a site put together by Simon Willison & Natalie Downe that hopes to gel the Django community at large into a more cohesive group. Simon puts it this way: I'm constantly surprised by the number of people I run in to at conferences (or even in one case on the train) who are using Django but are completely invisible to the Django community. It seems that this is the downside of having good documentation: many people just read it and start building, without ever showing their face on the mailing lists or IRC. The site allows you to ...
What does that mean in non-geek-speak? It means I can now make posts from a Metaweblog compliant desktop client of my choice. For me that would be the venerable MarsEdit! Took me about an hour to hack up, but I had implemented an Django -> XML-RPC interface on a project in the past, so I had some familiarity. That's enough "fun" for one night though ;)
Just thought I'd post here and let everyone know that I signed up for PyCon this evening. PyCon is the biggest Python Conference (and perhaps the only, who knows?). The coolest thing is that PyCon is taking place in Chicago for 2008 and 2009! Yay! I will only be attending for the conferences on Friday afternoon and the weekend and mostly for the web/Django related stuff. Also, just to meet people who I've only interacted with online. Those are the best parts about going to conferences.
Things have been moving extremely quickly in our run up to the week of Macworld over the past few days. Because I have so little time, I am proceeding to engage in a massive brain dump. In no specific order, here we go: I've secured a G4 Powerbook to use next week from our good friend Adam Received the Eye-Fi and discovered that it is extremely close to being able to perform the tasks I wished, but falls oh so short. I'll talk about those in an upcoming article on the device on Infinite Loop. Besides not being able to ...
I've been adding features to my blog as I've wanted them. Since I wrote this whole thing in Django, it's been fun, enlightening, and helpful to go through this process. I was already pretty good with Django prior, but the experience of building this site and adding on new features almost every day have really tightened up my skills and depth of knowledge of the framework. Two interesting things I've added in the past few days are: Site sends a Twitter direct message when someone leaves a comment. This is really cool and has already been helpful. I get a ...
There are updates at the bottom of this post and in the comments Do you use Gmail as your mail server in your Django projects? So far this has never been an issue, but I ran into it on this server. I have code in my project to shoot me an email whenever someone leaves a comment on the site, moderated or not. What I was seeing on my production server but not my development machine was that the mandatory SSL connection required by Gmail was timing out. Specifically, the error was this: Exception Type: sslerror Exception Value: The read ...
While compiling my 2007 year-end posting statistics post, I made an observation that I had built a nice following of commeters. My posting volume had gone down, my content length had increased, and with that, I saw an explosion in the number of people commenting on my blog. So with that information under my belt, I've finally got comments up and running here on the site. I'm using the largely undocumented (and unconverted to newforms) django.contrib.comments. Trust me, the built-in commenting that comes with Django is feature-packed and super-cool, but it could really use some documentation. However, I assume this ...
By the powers vested in me by Django's generic views, I have assembled a dedicated Tumblelog page for the site. The full content (or mostly) of bookmarks / shared items are shown, and photos are gathered together amongst the links and status updates.
I thought it would be useful for nerds, and specifically Django nerds, who might read this post to hear about how I threw it all together in a span of under a week. Most of the Django applications I'm using are detailed on my colophon page, but I'll reproduce it here and add more commentary. django-basic-blog by Nathan Borror. Provides simple Post and Category data models and helpful views. django-tagging by Jonathan Buchanan & Jacob Kaplan-Moss. Provides excellent data models, helpful model fields, template tags, generic views, and a tag manager to add tags to any of your Django models. ...
This post marks a very important point in time in my blogging career. I began what is now called "blogging" in April of 2001 with very basic posts like this one, about a month before the end of my sophomore year at Purdue. I was writing more for myself than anything else. I had produced a series of websites on my personal web space during high school (1998-1999) and into my freshman year of college (1999-2000). Over the summer of 2000 when I was taking summer school at Purdue, I had began tinkering with Linux, PHP, MySQL, and making dynamic ...
by Clint Ecker