Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
How to sell Python panel at Pycon
Do you want to use Python but are you fighting Fear, Uncertainty, and Doubt (FUD) in your organization? Does any of this sound familiar to you?Python is just a scripting language.Python is too new to use in real production environments.Language X has better benchmarks doing obscure math so it is better for web development.Python sounds great but we've already spent so much on this expensive tool that does things badly!A lot of people want to use Python, but their customer, management, school, government, or organization won't let them. Python is a great tool, but can be challenging to get in the door. This panel will explore how companies and individuals have successfully introduced Python, what tools are available to sell Python, how to fight the good fight, and what pitfalls there are to avoid.Panel QuestionsFor this event at Pycon I've got some stock questions ready but I want the community at large to suggest some more.SpeakersFor this panel I choose five speakers from the broad categories of academia, government, commercial organizations, and non-profit who have had a known impact in their organizations:AcademiaC. Titus Brown is an Open source hacker, Artificial Life/Digital Evolution, B.A. Math (Reed), Earthshine research, Ph.D. Developmental Biology and Regulatory genomics (Caltech), … -
CSRF: Flash + 307 redirect = Game Over
CSRF: Flash + 307 redirect = Game Over. Here’s the exploit that Django and Rails both just released fixes for. It’s actually a flaw in the Flash player. Flash isn’t meant to be able to make cross-domain HTTP requests with custom HTTP headers unless the crossdomain.xml file on the other domain allows them to, but it turns out a 307 redirect (like a 302, but allows POST data to be forwarded) confuses the Flash player in to not checking the crossdomain.xml on the host it is being redirect to. -
Solr, Jetty, and daemons: debugging jetty.sh
I recently added a Solr-powered search feature to this site (using django-haystack). Rather than go to the trouble (and server resources drain) of deploying Solr via Tomcat, I decided instead to deploy it via Jetty. There's a wiki page with detailed instructions for deploying Solr with Jetty, and the wiki page also includes a link to the jetty.sh startup script. The instructions seem simple enough. However, I ran into some serious problems when trying to get the startup script to work. The standard java -jar start.jar was working fine for me. But after following the instructions to the letter, and after double-checking everything, a call to: sudo /etc/init.d/jetty start still resulted in my getting the (incredibly unhelpful) error message: Starting Jetty: FAILEDMy server is running Ubuntu Jaunty (9.04), and from my experience, the start-stop-daemon command in jetty.sh doesn't work on that platform. Let me know if you've experienced the same or similar issues on other *nix flavours or on other Ubuntu versions. Your mileage may vary. -
New Careers Page Inaugurated with Django Job Posting
I'm pleased to announce that we just released a new Careers section of our web site here at Caktus.  The section has been inaugurated with a new posting for a full-time Django developer position based out of our Carrboro, NC office (not far from Raleigh, Durham, or Chapel Hill), so kindly check it out and ... -
New Careers Page Inaugurated with Django Job Posting
I’m pleased to announce that we just released a new Careers section of our web site here at Caktus. The section has been inaugurated with a new posting for a full-time Django developer position based out of our Carrboro, NC office (not far from Raleigh, Durham, or Chapel Hill), so kindly check it out and let us know if you or someone you know might be a good fit! -
django CMS 2.1.1 released
django CMS 2.1.1 released -
Geographical django website demo
One of the reasons I gave for giving me a mac was I'll be able to make proper screencasts. I've got a mac now, so I have to make screencasts :-) The style I thought out for myself is to make two different versions of each video: One on my personal title on my own blog on my own smugmug account. I get to decide what to say and what to show, naturally. I'll do it in English and I'll show the technical aspects. One for Nelen & Schuurmans. A bit more polished and a bit less personal. In Dutch :-) And focused more on our customers' language. Not all videos that I make will get that second version, probably. Anyway, I've got a new toy to play with (again) and I've made my first screencast in two years! What do I want to show in this screencast? Hey, we make pretty OK geographical websites with lots of water data behind it. Hey, it is all working pretty OK. Not always terribly fast, but that's because we didn't get to the proper caching part yet. There's no TileCache or whatever to speed it all up. Just a bit of basic … -
Geographical django website demo
One of the reasons I gave for giving me a mac was I'll be able to make proper screencasts. I've got a mac now, so I have to make screencasts :-) The style I thought out for myself is to make two different versions of each video: One on my personal title on my own blog on my own smugmug account. I get to decide what to say and what to show, naturally. I'll do it in English and I'll show the technical aspects. One for Nelen & Schuurmans. A bit more polished and a bit less personal. In Dutch :-) And focused more on our customers' language. Not all videos that I make will get that second version, probably. Anyway, I've got a new toy to play with (again) and I've made my first screencast in two years! What do I want to show in this screencast? Hey, we make pretty OK geographical websites with lots of water data behind it. Hey, it is all working pretty OK. Not always terribly fast, but that's because we didn't get to the proper caching part yet. There's no TileCache or whatever to speed it all up. Just a bit of basic … -
The big secret project I've been working on...
With the official press release out the door, I can finally start talking about the project that has been consuming most of my time for the last several months! StoryMarket is an online system for making finding, buying, selling and sharing content a la carte easy. It's primarily focused towards journalists and the news industry, but we expect there to be a large contingent of bloggers and other new media content creators from all sectors. StoryMarket was developed as a partnership between Revolution Systems and The World Company, publisher of the Lawrence Journal-World the same great company that brought us our beloved Django. The news industry is in trouble, with declining revenues and increasing costs, the old content syndication models are proving to be more than smaller organizations can bear. You can think of it as a mashup of eBay or Etsy and iTunes with a strong social component similar to LinkedIn. Sellers are given extremely flexible tools for managing their individual prices and rights. From being really open and cheap, to being really restrictive and expensive and everything in between. For example, I could give this particular blog post a price of $20 to all StoryMarket users, $10 for … -
Django and Remote Sybase Servers
It took me a while to figure it out, so I decided to share. DATABASES = { 'default': { 'ENGINE': 'sqlany_django', 'USER': 'YOUR-USER', 'PASSWORD': 'YOUR-PASSWORD', 'OPTIONS': { 'links': 'tcpip(host=YOUR-DB-IP-OR-HOSTNAME;DoBroadcast=None)', 'ServerName': 'YOUR-SERVER-NAME', }, } } For the sake of completeness, connecting via the regular DB API would be: sqlanydb.connect( links='tcpip(host=YOUR-SERVER-HOST;DoBroadcast=None)', ServerName='YOUR-DB-NAME', uid='YOUR-USER', pwd='YOUR-PASSWORD' ) It’s not hard – but tedious to tinker out. -
Evented Django part one: Socket.IO and gevent
The buzz around the asynchronous, real-time web has been getting more and more attention lately, and for good reason. The old paradigm of thick servers and thin clients is getting outdated as the new web demands rich, fast, asynchronous, full-duplex messaging. The technologies that enable server-to-browser asynchronous messaging have been given the umbrella term "Comet," and the number of ways to provide Comet services is growing constantly. The transport options include XHR-multipart, WebSockets, and Adobe Flash Sockets, among others. Socket.IO was invented to provide a unified interface for server-browser messaging and let the developer not worry about the inconsistent browser support. In this post, I'm going to explain how to use Django with Socket.IO.Socket.IO was developed with a Node.JS server implementation, but work is being done to add server implementations to a variety of languages. Two such servers exist for Python, tornadio and gevent-socketio. I'm a big fan of gevent, so I will use gevent-socketio, but tornadio looks well-written and very promising. Why you should be thinking about gevent Socket.IO runs great under Node.JS, but I think it's important to highlight why I think Python and gevent need more attention (feel free to skip ahead if you have already drank … -
Rename uploaded files to ASCII charset in Django
Last time I had to substitute files from backups brought unpleasant surprise. About 80 files, thats 10% of all files, did not display on website. Digging into issue fast revealed that all those files contained exotic, non ASCII characters in them. Django does not convert uploaded unicode filenames, and all modern operating systems have support for unicode filenames. Amazon S3 have support for unicode filenames. The problem was, that sync scripts that was used to backup files does not have so good support for unicode in filenames. Fortunately changing Django default file storage so it saves all files in ASCII encoding takes only two steps: 1. Subclassing default FileSystemStorage: import unicodedata from django.core.files.storage import FileSystemStorage class ASCIIFileSystemStorage(FileSystemStorage): """ Convert unicode characters in name to ASCII characters. """ def get_valid_name(self, name): name = unicodedata.normalize('NFKD', name).encode('ascii', 'ignore') return super(ASCIIFileSystemStorage, self).get_valid_name(name) 2. Tell Django to use ASCIIFileSystemStorage as default storage. This is to be added in settings.py. DEFAULT_FILE_STORAGE = 'utils.storage.ASCIIFileSystemStorage' More info about File storage is available in Django documentation. -
Django on twistd.web.wsgi – Issue Workaround
My last few posts have generally been about my final year project - Backtrac Backup System. One of the recent challenges I faced was getting the Django-based web interface to run under the Twisted WSGI server. In this post, I'll describe a major issue with this process, and how I worked around it. TAC or [...] -
development with virtualenv
`Virtualenv `_ is a tool for isolating `Python `_ projects. Such Python projects can have their own set of packages and their versions without affecting each other. This article will tell you how to create and work with such environments and how to use them with your `Django `_ projects. This is a follow-up to the `last article `_ on virtualenv and pip. -
Announcing django-constance
`django-constance `_ is live settings for `Django `_ in `Redis `_ featuring a Django admin interface and easy migration from your static Django settings. -
Profiling Django Projects with Cachegrind
Your site is slow in the production and you do not know why. It is time to profile it while it is running live: with `cProfile `_ and `KCachegrind `_. You will get very nice charts and tables with time information and other data. It will show where your bottleneck is. -
Trying: REST api design
Two months ago I made my opinion about SOAP and REST clear. Happily, I now have a small project where I have to actually make a REST interface. So here's some preliminary thinkwork. Suggestions welcome! My thought on what a proper REST api ought to be about: Linked data. No magic URLs which you have to know exactly. From a root URL, you should be able to find everything you need by just following the URLs. So not a list of IDs of something that you have to hand-craft a URL with, but simply a list of URLs with the ID already included. Json. In principle, json is returned. No html, no xml. Json is the de-facto simple data exchange format nowadays. Images, html, wms: those are alternative representations that can be requested. Self-describing. Adding a couple of 'name' and 'explanation' attributes to the json helps a lot in explaining the data. It aids discovery and debugging. Resource-based. The 'normal' part of the URL is for identifying resources. Extra parameters (?width=100&height=80) are for small tweaks and adjustments. Identify resources, not actions. Give every resource a URL, restrict the use of verbs. So not /get_document?id=42, but /documents/42. In our case, in … -
JOINs for NoSQL databases via django-dbindexer - First steps
At the moment, we have a lot to do in terms of finishing our diploma thesis. However we're so excited about the early results of the currently refactored django-dbindexer that we couldn't hold back and keep django-dbindexer's simple JOIN support for non-relational databases a secret anymore. Yes, you didn't read wrongly, this post is about JOIN support for NoSQL databases! We'll show how to use in-memory JOINs and how to get JOINs working if the joined field's value doesn't change. So let's unpack our delayed Christmas present. ;) Let's rock! Let's take the example of a photo-user relationship, just like in our post JOINs via denormalization for NoSQL coders, Part 1: # photo/models.py: from django.contrib.auth.models import User from django.db import models class Photo(models.Model): owner = models.ForeignKey(User, null=True, blank=True) popularity = models.IntegerField(choices=[(0, 'low'), (1, 'medium'), (2, 'high')], default=0) published = models.DateField(auto_now_add=True) title = models.CharField(max_length=500) Here, each photo entity is linked to a user via a many-to-one relationship and has a popularity tag assigned to it. Additionally we store the date when the photo has been published and give the photo a title. Now let's say you want to get all of a user's photos. In order to do so, NoSQL databases … -
Giving Back to the Community
We're big fans of open source, so we like to give back to the community whenever we can. Having a strong community is actually personally and professionally selfish: a vibrant community not only helps ensure we keep getting to eat on a regular basis, but it also means there is more useful code available for us to use. Neither Jacob nor myself would be in the position we're in if it wasn't for the open source community. So even though we're a small company, in 2011 we're trying to really step up the ways we give back to the community. Office Hours We'll be holding another one of our IRC "office hours" in #revsys on Freenode this coming Friday, February 4th, from 3-5pm Central. We held our first a few months ago and it was not only successful, but fun so we're doing it again. We hope to have enough time to do this at least a few times a year. Sponsoring PyCon Where would we be without Python? Sure we could have spent this money on a new hot tub for the office, or perhaps adding another runway to the RevSys HQ airstrip, but we figured helping PyCon be … -
ReCaptcha in Django Forms
Using ReCaptcha widgets in forms managed by Django -
What I want for Django Facebook connect
For a customer I need to do Facebook authentication on a new Django project. I went to the Django Packages Facebook Authentication Grid and figured I would plug it in, set some keys, and go! Facebook authentication is a common client requirement, and this must have been solved many times over, right?Unfortunately, most (I'm still going through them) of the listed packages worry me. Security is HARD. Security is DANGEROUS. Since Facebook auth is a common requirement I shouldn't be forced to roll my own authentication or hack through someone else's implementation to get things working.Yet many of the packages listed in the grid above lack documentation or what exists is outdated. Some of them simply drop errors or seem to intentionally obfuscate them (I won't name anyone YET because I want to give people a chance to correct these issues). Finally, I've yet to find any with any sort of logging to help diagnose possible intrusions or just as a way to see what is happening when you have trouble hooking up things.I understand that Facebook is a moving target. But on the other hand, shouldn't updates to these things be in place?So what do I want in a … -
Roadmap to 2.2
Roadmap to 2.2 -
Post on Request
In the last few weeks I have been little busy(and suffering from lack of inspiration) so my blog lacks of new posts but I see that there are people visiting it(especially for the Django CMS stuff) so I am willing to start a “Post on Request” practice. The idea is simple – I will collect [...] -
A (Complete) Guide to Running Django on Joyent Shared Accelerators using Virtualenv, pip, git, and NginX
A (Complete) Guide to Running Django on Joyent Shared Accelerators using Virtualenv, pip, git, and NginX -
FOSDEM 2011 and GNOME Foundation
That’s right, once again I could count on Igalia‘s kind support to be able to go to this great conference one more year. Just like last year, I’m giving two presentations: * Making the printed world accessible: A11y in OCRFeeder, in the Accessibility DevRoom on Saturday at 11:00; * Grilo: Integration of Multimedia Contents in [...]