Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
eSteak - hot MooTools slices
By now there are many javascript frameworks available that make programming easy and encapsulate new and cool functionalities. Surely every framework has its advantages and disadvantages but in my opinion you can't switch between all of them - you have to deceide in favour of one. In my case I have chosen Mootools, as you may have already seen here... A friend of mine and also a co-worker, Grundi, has created a site that answers to the beautiful name of "eSteak" that unites the different scripts for Mootools on a central place, with rating, Mootools dependency listing and so on. The whole thing is user generated content, so its up to all the Mootools developers and even to you to upload scripts and support it! Because the problem with Mootools is that there are really cool scripts out there, but you first have to find them. I hope that eSteak will be filled with a lot of scripts and that it will develop to the central place for Mootools friends and enthusiasts. Update (somewhen in 2013): unfortunately eSteak was taken to the grave in 2010 - check this blog post for more information: http://blog.aplusmedia.de/2010/10/19/esteak-net-end-of-life-announcement/ -
Adding InnoDB to sqlall output
Have you ever wondered why you can’t have manage.py sqlall output your create table statements as InnoDB tables for mysql? Well I have. I always go in and update the statements by hand to add that after the fact. So I did a bit of pokeing around and figured out a hack to add in [...] -
Yahoo! UI (YUI) + Django templates == Google Code project! FTW!
Let me first preface this blog by saying that I’m not a designer. When it comes to art and creativity, I’m so left brained, I actually wonder if my right brain even partakes in the process. Three things spurred me to release django-yui-layout-templates. I’ve always wanted to see what GoogleCode offered in relation to SourceForge / RubyForge. I’m so caught up in corporate America staring at Java / Ruby code all day, not only haven’t I blogged about anything Django related in quite a while, but it’s nice to get some commentary from the community, i.e. “your code sucks”. (Brings me back to reality) I found myself using the same templates on a variety of projects and figured that I could do my part and help eliminate unncessary cruft/duplication. So without further adieu, check out the project here. I know, I know – nothing revolutionary here, but I figure since Django is picking up some steam, these templates might help a Djangonaut get a head start on their next million dollar idea. Voila! Enjoy! -
ActiveResource for Python
I’ve begun porting Ruby on Rails’ ActiveResource to Python. This is especially useful when dealing with APIs (such as the one I’m currently developing for Slicehost) or other ActiveResource implementations without having to use Ruby (or Rails). -
YUI datatables does not work for IE ?
I have been playing around with the datatables from Yahoo UI package for one of my customers. Much to my surprise though the code does not work for IE. I have been googling around for somebody reporting the same issue but so far I haven't found anything to the effect. I am just following the same example from the YUI site. On using YUI for my work, everything is good but then there are a few issues I am running into :1. caching on the datatable itself does not lend itself to easy doing.2. compatibility issues between browsers doesn't lend itself friendly to enterprise solutions.Going to look more into this. -
PyCon Braindump
PyCon 2008 Brain Dump There are some great roundups of the content at PyCon out there; this isn’t one of them. See, I have this notebook (Moleskine FTW!) I carry with me everywhere, and now it’s chock-full of note from PyCon; this is a braindump. EAV Mammoth replicator Django 1.0 will support Python 2.3, but later releases likely will not. We’ll need to start working on moving to Python 3. -
Help OSI
I try not to get political here, so I’ll try to keep this as neutral as possible. Bruce Perens is running for a board seat at the Open Source Initiative and has asked for public support. My take on this should be pretty obvious from the fact I’ve signed the document. Whether you agree or me or not, though, I’d please ask you to still take a few moments and learn about the debate. -
Django Mercurial mirror tweaks
I really enjoyed my participation in the last Django sprint, but prior commitments prevent me from participating in the PyCon Django sprint that begins today. On the chance that people may be taking advantage of my Mercurial mirror of the Django repository, I made a couple tweaks: Increased the update frequency from hourly to every 15 minutes Added downloadable gzipped tarballs (about 2.5MB for trunk). Have fun! -
WhisperGifts Sees the Light of Day
I got married in March 2007, within a few months of a number of friends. We all shared our trials and tribulations as we each prepared for our big events, and a number of common issues arose. One of these common points of confusion was the preparation of a bridal gift registry - a list of gifts that we would love to receive from our guests. Being somewhat geeky, I started to put together an online bridal registry system that could not only be used by my fiance and I, but also by our friends and family. This case of scratching an itch turned into a service that would eventually become WhisperGifts, the first public offering of Jutda. This service evolved over time into a solution suitable for the commercial prime-time and as of today is ready for public consumption at whispergifts.com. Here's just some of the major benefits of WhisperGifts: Allows your guests to shop at any store they like. Aunty Mary who works for MegaTVCorp can now buy you that 42-inch LCD that you want, without paying department store prices Allows you to describe the types of items you want, rather than selecting a brand and model Lets … -
WhisperGifts Sees the Light of Day
I got married in March 2007, within a few months of a number of friends. We all shared our trials and tribulations as we each prepared for our big events, and a number of common issues arose. One of these common points of confusion was the preparation of a bridal … -
Jutda - Django-powered Solution Provider
In my recent catchup blog post I mentioned in passing a few projects including Jutda and WhisperGifts. Now, I'd like to formally introduce the former of these (with the latter coming very soon now) When I'm not 'at work', I spend a significant amount of time working on other projects both independently and together with other talented developers. These days, all of these projects are powered by Django. Jutda is the glue that will pull these projects together under a single name. The name comes from the nearly-extinct Wagiman language, spoken by a small number of indigenous Australians. It means "to point" or "to show", which I've taken on as the ethos of my new company: We’re aiming to show the way to others, to make life easier through the use of elegant online solutions. The ultimate aim is to create simple solutions for everyday problems. No bells, no whistles, just beautiful outcomes for ugly problems. More information about Jutda can be seen on the About Jutda page, and in the initial blog post I published on the Jutda website. The first project that's been finished and published is WhisperGifts, about which I'll write more in a future blog post. … -
Jutda - Django-powered Solution Provider
In my recent catchup blog post I mentioned in passing a few projects including Jutda and WhisperGifts. Now, I'd like to formally introduce the former of these (with the latter coming very soon now) When I'm not 'at work', I spend a significant amount of time working on other projects … -
Generic search engine pinging for Django
The Django contrib sitemap framework provides a way to let Google know when your sitemap has been updated. It's simple enough to add Ask and Yahoo; until I can get a patch contributed, this module is an easy way to ping them all. -
Sitemap class for direct-to-template generic views
A simple way to include direct-to-template pages in the sitemap of your Django site. -
Django through Apache on Ubuntu
To: /etc/apache2/httpd.conf Add: <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE <project>.settings PythonDebug On PythonPath "['/parent', '/parent/project'] + sys.path" </Location> I found the instructions a bit confusing on the site. So I hope this clears up things a bit. My thought is they think the setup for live systems and where those files reside is [...] -
Installing Django from SVN and setting up django-registration (on Ubuntu)
Go to the shell and navigate to a directory that you want to leave the Django codebase. then enter the following code to check out the current codebase from Django: svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk Next you will need to make a symbolic link to the Django codebase: sudo ln -s `pwd`/django-trunk/django/ /usr/lib/python2.5/site-packages/django Link to django-admin, [...] -
Anatomy of a Python C Module
Writing Python modules in C is relatively easy. The main reason to do so is to increase performance over using Python code. I will demonstrate how to implement a Fibonacci Python function in C. -
Book news: Rough Cuts and Amazon
Just in time for Pycon, material from our new book is now available on the Safari "Rough Cuts" service. If you're a Safari subscriber, or decide to become one to get access to our draft chapters, please check it out and let us know what you think! Reader comments are incredibly important to us. We have a title now -- Python Web Development with Django -- and we're even listed on Amazon. Here's a summary blurb for those curious about how we are positioning the book: As a web developer, you want to program in a language that is powerful, clean, mature, and well-documented, and one that is equipped with a great standard library and a huge selection of high-quality third-party packages. You also want a web framework for that language--one with a vibrant, helpful community of users and developers, and one that is designed to function smoothly as an integrated stack, but whose components are loosely coupled so that you can make substitutions if circumstances require. In short, you want Python and you want Django. This book -- which includes a special "Practical Python for Django" chapter for those who need a language introduction or review -- is designed … -
Accepting NULL value in URL
Within my Django project I wanted to have a page within the site for example “/page”. For that site I want there to be an optional value the page can take. So any of the following examples are acceptable: “/page/1″, “/page/2″, “/page” There are two ways to do this. First way (which is probably the [...] -
Separating Development and Production Settings in Django
Django does not have a built-in way of having development only settings. Luckily for us, Django settings is nothing but a simple python module. This allows us to implement our own way of dealing with settings right in the settings.py file. On This Week in Django episode 4 (great podcast!), Michael Trier featured a Tip of the Week on how to implement development only settings. Since I like to have everything checked in to my Mercurial repository, I extended the code to allow local settings to exists on my production server without being loaded. The original version. 1 2 3 4 5[..] try: from local_settings import * except ImportError, exp: pass My version. 1 2 3 4 5 6 7[..] import socket if not socket.gethostname() == "omh.cc": try: from local_settings import * except ImportError, exp: pass It’s very simple. All it does is to check the host name and only import local_settings.py if host name is not “omh.cc”, which is the name of my server. -
Simplify Django's Free Comments Redirection
Django, with its battery included philosophy has several very nice features included. One of these cool features is the comments contrib application. In a few minutes, I was able to add commenting with Markdown highlighting to my blog. Not bad for a Django beginner. I opted to remove the annoying “Thanks for commenting” page and redirect directly back to the blog post. The Free Comments Wiki page explained how to do just that. However, it felt like way too much hassle, too much tinkering for a simple redirect. I live, uhm…, code by the motto: Less code is better code. Here’s my simplified approach. Add a line to your urls.py file overriding the default /comments/posted/ view. 1 2 3 4[...] ( r'^comments/posted/$', 'blog.views.comment_posted' ), ( r'^comments/', include( 'django.contrib.comments.urls.comments' ) ), [...] Make sure to add the urls.py line before the inclusion of comments. Now, create the comment_posted() method in your views.py file. 1 2 3 4 5 6 7 8 9 10 11 12 13from django.http import HttpResponseRedirect from mysite.blog.models import Post def comment_posted( request ): if request.GET['c']: comment_id, post_id = request.GET['c'].split( ':' ) post = Post.objects.get( pk=post_id ) if post: return HttpResponseRedirect( post.get_absolute_url() ) return HttpResponseRedirect( "/" ) That’s it. 10 lines of … -
Django Redirects (Updated)
This is a quick-n-dirty app to let you set up redirects on your Django site through the admin interface. (Updated to reflect my own oversight of django.contrib.redirects, which, er, does all this for you...) -
Django Redirects (Updated)
This is a quick-n-dirty app to let you set up redirects on your Django site through the admin interface. (Updated to reflect my own oversight of django.contrib.redirects, which, er, does all this for you...) -
Django Redirects (Updated)
This is a quick-n-dirty app to let you set up redirects on your Django site through the admin interface. (Updated to reflect my own oversight of django.contrib.redirects, which, er, does all this for you...) -
Django error notification with jabber
Django has a code error notifications mechanism when a view raises an exception. It will email the people in ADMIN tuple(settings documentation) in settings.py with the full exception information and displays the default 500.html template. This only happens when DEBUG=False in the settings.py. It's possible to set a handle that change this behavior with a handler500 variable in the root urls.py. So, we can easily write a simple view that sends an error notification to our jabber account. First of all, you need to install xmpppy and dnspython: $ easy_install xmpppy $ easy_install dnspython Add to settings.py the jabber parameters such as the jabber id, password, recipient, etc.: JABBER_ERROR_NOTIFICATION = True JABBER_ID = 'your_jabberid@jabberdomain.com' JABBER_PASSWORD = 'your_jabber_password' JABBER_RECIPIENT = 'recipient@jabberdomain.com' JABBER_ERROR_TEXT = 'An error occurred in "Project Name", please check your email.' Start a new app named errors or something else and add it to the INSTALLED_APPS tuple in the settings.py: python manage.py startapp errors Add a handler500 variable with the view in the root urls.py: handler500 = 'errors.views.server_error_jabber' Finally add the view in errors.views that sends a jabber notification and returns a 500 error page: from django.views.defaults import server_error from django.conf import settings import xmpp, time def server_error_jabber(request, template_name='500.html'): …