Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
PyCon Philippines 2012 Day 2
The second day of PyCon Philippines 2012 had a really good turnout. My unofficial estimate is that we had about 90% of the attendees from the first day attend (with the unfortunate exception of most of the faculty and students of Agoo Computer College). The day started with... Lightning Talks Unfortunately I don't normally take notes on lightning talks. I'm kicking myself now. Really hard. I'll try and relate some of the talks: Import this and that, a parody talk by Daniel Greenfeld (me). Malcolm comment on it. Getting into space using weather balloons by Frank Pohlmann Ponystrap by Audrey Roy (video from DjangoCon Europe) Call for Tagalog and other Philippine languages translation of Django by Malcolm Tredinnick The obligatory PyCon lighting talk on Vim by Bryan Bibat OpenERP by Frank Pohlmann and Ann Tan-Pohlmann A parody talk by Sony Valdez Then it was on to... Sprints and Tutorials Encouraged at #pyconph seeing so many people declaring themselves beginners and then diving in. Enthusiasm was a bit contagious. —Malcolm Tredinnick on twitter Primary funding for the sprints came from the Django Software Foundation and Python Sprints. That funding went towards food, drinks, and various logistics for handling the estimated 200+ … -
PyCon Philippines 2012 Day 2
The second day of PyCon Philippines 2012 had a really good turnout. My unofficial estimate is that we had about 90% of the attendees from the first day attend (with the unfortunate exception of most of the faculty and students of Agoo Computer College). The day started with... Lightning Talks Unfortunately I don't normally take notes on lightning talks. I'm kicking myself now. Really hard. I'll try and relate some of the talks: Import this and that, a parody talk by Daniel Greenfeld (me). Malcolm comment on it. Getting into space using weather balloons by Frank Pohlmann Ponystrap by Audrey Roy (video from DjangoCon Europe) Call for Tagalog and other Philippine languages translation of Django by Malcolm Tredinnick The obligatory PyCon lighting talk on Vim by Bryan Bibat OpenERP by Frank Pohlmann and Ann Tan-Pohlmann A parody talk by Sony Valdez Then it was on to... Sprints and Tutorials Encouraged at #pyconph seeing so many people declaring themselves beginners and then diving in. Enthusiasm was a bit contagious. —Malcolm Tredinnick on twitter Primary funding for the sprints came from the Django Software Foundation and Python Sprints. That funding went towards food, drinks, and various logistics for handling the estimated 200+ … -
WhisperGifts: The Tech That Let Me Launch
The WhisperGifts re-launch recently went very well! I promised a more technical follow-up with some details about what's new and what's changed, so if you want to know more about what makes WhisperGifts tick then you'll want to read on. Hint: It's a dash of Django, a pinch of Python, and a slathering of open-source software all around. -
WhisperGifts - The Tech That Let Me Launch
The WhisperGifts re-launch recently went very well! I promised a more technical follow-up with some details about what's new and what's changed, so if you want to know more about what makes WhisperGifts tick then you'll want to read on. Hint: It's a dash of Django, a pinch of Python, and a slathering of open-source software all around. The primary technology behind WhisperGifts is Django, the "web framework for perfectionists with deadlines". My own deadline for this project was rather, ahem, flexible - the new design was a work in progress for 2 years (on-and-off, mostly off due to the birth of our baby) and the back-end re-write happened over a few months early in 2012. Django allows us to iterate quickly. I find the language natural to use and the documentation is epic. There's a number of things that no framework does out of the box; I've tried to rely on open-source to fill as many gaps as possible rather than re-writing things from scratch like I did with the original WhisperGifts site - this is mostly because the open-source ecosystem around Django is now so much larger than it used to be. As an example, originally I rolled … -
WhisperGifts - The Tech That Let Me Launch
The WhisperGifts re-launch recently went very well! I promised a more technical follow-up with some details about what's new and what's changed, so if you want to know more about what makes WhisperGifts tick then you'll want to read on. Hint: It's a dash of Django, a pinch of Python … -
PHP, Python and Persuasion
I always find it fascinating to observe conversations in which people's arguments fail to convince each other. A few days ago we witnessed some PHP debates, kicked off by Jeff Attwood. I foolishly got slightly involved on one ‘rebuttal’. At church last Sunday I also chatted with a friend who has used PHP and likes it, and this time I tried to put myself in his shoes. It is often much more helpful talking to people in the flesh, and I think it is always enlightening to look at why we fail to convince. One reason we can't rule out is simple irrationality. All of us are vulnerable to confirmation bias, and people will often go to great lengths to convince themselves that they are doing the right thing and do not need to change their views or practices. You see this all the time when two groups of people share experiences after having made different decisions about how to spend some leisure time. Both groups are often desperate to believe that they haven't missed out, and will seek to persuade each other (but in reality, persuade themselves) that they were in the group that had the most fun. However, … -
Create Text & Online Versions of Emails Automatically
For this i’ve created django-firstclass. Firstclass is a proxy email backend for Django that allows for global email transformations such as automatically creating a plain text version of html emails or automatically creating an online version of the email that can be read in browser. My goal was to have this be a drop in solution requiring no change to a code base. I also wanted this to be flexible enough so that it can work with a wide variety of projects. I accomplished this by adding a middleware pipeline to Django’s email process. I’ve bundled a few useful middleware in and plan to add a few more. Creating your own middleware is simple. Middleware is a single Python class that defines process_message. For example if you wanted to create a middleware that would add a tracking pixel to all of your emails: http://gist.github.com/3048960 You would then simply add TrackingPixelMiddleware to FIRSTCLASS_MIDDLEWARE. https://github.com/amccloud/django-firstclass -
TND dataview and metaclass magic in python - Maarten ter Horst
-
Rethinking the Django-CMS landscape - Diederik van der Boor
-
Document automation (Office) using Django - Henk Vos
-
Building single-page web-applications with Django, Twisted and TxWebsocket - Jeroen van Veen
-
PyCon Philippines 2012 Day 1
PyCon Philippines 2012 (PyCon PH) happened just this past weekend at the University of the Philippines Diliman (UP Diliman) campus in Quezon City, which is part of Metro Manila. I can assure you that PyCon PH was an wonderful, amazing, humbling experience. I'm hoping that this post and others will get across to you why. Arrival Frank Pohlmann, chairman of PyCon Philippines picked us up and drove us to the event. He had worked day and night getting the event ready, all the while running his company, working a job, and being a father to his lovely 21 month old daughter. As we arrived at the venue, Audrey and I were met by our good friend, Filipino-American Bryan Veloso of Github, who was to provide the closing keynote. As soon as Bryan heard that there was going to be a PyCon in the Philippines he gave up his trip to Europython to be a speaker at PyCon PH. Inside the Institute of Electrical and Electronics Engineering, we were greeted Ann Tan-Pohlman, logistics co-chair and volunteer organizer. She had over a dozen volunteers getting ready for the oncoming flood of registrants. More on the herculean efforts of the organizers and volunteers … -
PyCon Philippines 2012 Day 1
PyCon Philippines 2012 (PyCon PH) happened just this past weekend at the University of the Philippines Diliman (UP Diliman) campus in Quezon City, which is part of Metro Manila. I can assure you that PyCon PH was an wonderful, amazing, humbling experience. I'm hoping that this post and others will get across to you why. Arrival Frank Pohlmann, chairman of PyCon Philippines picked us up and drove us to the event. He had worked day and night getting the event ready, all the while running his company, working a job, and being a father to his lovely 21 month old daughter. As we arrived at the venue, Audrey and I were met by our good friend, Filipino-American Bryan Veloso of Github, who was to provide the closing keynote. As soon as Bryan heard that there was going to be a PyCon in the Philippines he gave up his trip to Europython to be a speaker at PyCon PH. Inside the Institute of Electrical and Electronics Engineering, we were greeted Ann Tan-Pohlman, logistics co-chair and volunteer organizer. She had over a dozen volunteers getting ready for the oncoming flood of registrants. More on the herculean efforts of the organizers and volunteers … -
django CMS 2.3 released
-
Multiple File Uploads in Django
Here is a quick example of how to add a multiple file form to your Django application. Most multiple-upload front-ends were created without Django in mind, so interfacing with tools is not always straightforward as it might be with a different language. Thankfully, there are a couple of Django libraries ... -
AJAX and Django Views
It seems that cleanly and easily doing AJAX views in Django is an area that gives a lot of people trouble. We like to do views as straight HTTP if at all possible, but there are always interactions that would be better served by not having a page load. We're also big fans of django-tastypie but it's a whole other ball of wax on its own, especially if you want to have views that write to the database. So, for the purposes of getting everyone up to speed doing AJAX with Django, we'll ignore Tastypie for now and just stick with ordinary views. Django automatic CSRF To start things off, put this bit of Javascript from the Django docs into a script that's loaded on all the pages where you'll be needing to perform AJAX views. This allows you to ignore the CSRF token for AJAX views, but it will be added as a request header. We previously said this could be seen as a security loophole and that same-origin came into effect. Both of these statements are wrong. AJAX & Form Field Errors Before we get to the Django side, there are a few small scripts that we recycle … -
Generic Layouts in Crispy Forms
Just a quick tip and sanity check, today, about something I ran into with django-crispy-forms, the awesome new form library from Miguel Araujo. This morning, I converted the project we've been building for a client (currently some 1,700 or so files, counting templates, CSS, and icons) from django-uni-form to django-crispy-forms. It's a pretty painless transition, actually. Just do some find-and-replace across your files, basically changing any instance of uni- to crispy- (well, and form to forms), and you're good to go. Then, however, I wanted to convert two large forms that we have, which share 90% of their fields, to using the sharable Layout objects that django-crispy-forms gives us. Basically, the forms looked like this: class FirstForm(GenericAppFormForTheExample): ... def __init__(self, *args, **kwargs): ... self.helper = FormHelper() self.helper.layout = Layout( "field1", "field2", "special-field", [field3 through field20] class SecondForm(GenericAppFormForTheExample): ... def __init__(self, *args, **kwargs): ... self.helper = FormHelper() self.helper.layout = Layout( "field1", "field2", "special-field2", [field3 thorugh field20] Obviously that was a lot of repetition that we could cut out now that these inheritable layouts exist. By the way, I'm pretty sure this would have been possible in django-uni-form but likely not as friendly. First I started off by creating the shared resources. … -
Our Custom Mixins
UPDATE: We've released a Github repo and a PyPI package with our mixins. Feel free to fork and submit new ones through a pull-request. Let's just start out and say it, Class Based Views. Ooohhhh. Unfortunately the topic of class based views is thought of as somewhat of a dark art in the Django community. It doesn't help that the documentation is still lacking but I find a lot of people, especially on Reddit, refuse to use them. For whatever reason, it's a hard pill for some to swallow. Before DjangoCon 2011, we started playing with class-based views. At first they seemed like a nightmare and without decent docs, we got frustrated really quickly. Skip forward to today and I can't imagine writing old function-based views again. Some argue that the generic views are only for generic applications and that, somehow, their work is far too custom and complex to be handled in a generic class-based view. Based on my experience, 99% of the time, they would be wrong. We plan on covering generic class-based views extensively with GSWD. Today, I'd like to share some mixins we have cooked up, on a rather large client project, that have helped us … -
User-friendlier model forms
Recently, in our large client project, we had need of fields, in a model form, that accepted multiple types of input, but sanitized the data for the model. For example, the rent field, on the form, needs to handle a rent range (e.g. 900-1200), a single amount, or be overridden or extended by other bits of information, like "call for details" or "on approved credit". Obviously we don't want to have to parse this out every time we read the data. So, enter our fields that tear data apart and put it together every time it passes through. Model Let's go over our Rent model first. It's an abstract model so we can use it in multiple places (we have more than one logical model in the system that needs to deal with rent, this way we can use it multiple places without having to hold on to a huge amount of joins). We have several other abstract models that perform the same actions as our Rent model, but I won't show them here. from django.core.exceptions import ValidationError from django.db import models class Rent(models.Model): rent_low = models.PositiveIntegerField() rent_high = models.PositiveIntegerField(blank=True, null=True) rent_percent_income = models.FloatField(blank=True, null=True) rent_oac = models.BooleanField(default=False) rent_call_for_details = … -
Extending time and details
For the fun of it I added an "Extended Room" contrib to Evennia the other night.("Contribs" are optional code snippets and systems that are not part of the actual codebase. They are intended for you to use or dissect as you like in your game development efforts).The ExtendedRoom is a room typeclass meant to showcase some more advanced features than the default one. Its functionality is by all means nothing revolutionary in MUD-world, but it was fun and very simple to do using only Evennia's basic building blocks - the whole thing took me some two hours to code, document and clean up for a contrib push. The "ExtendedRoom" contribution has the following features:Season-based descriptions. The new Room typeclass will change its overall description based on the time of year (the contrib supports the four seasons, you can hack this as you please). It's interesting from an implementation point of view since it doesn't require any Script or ticker at all - it just checks on-demand, whenever it is being looked at, only updating if the season has actually changed. There is also a general description used as a fallback in case of a missing seasonal one.Time-of-day-based descriptions. Within each … -
Testing As a Different Django User
All types of Django auth do basically the same thing: They associate a browser session ID with a Django user if the user logs-in successfully. I found a neat technique to bypass a Django login by modifying with a Django session, which can be useful for testing purposes.Why is ... -
Long Time No See
Hello again everyone! Soooo much has happened since I last posted on my blog. I figured it was about time to check in and actually be active on my own site again. What follows is just a summary of what has happened in our lives since the beginning of February this year. Leaving ScienceLogic First of all, my wife and I decided toward the end of 2011 that it was time for us to move away from Virginia. For reasons that we did not quite understand yet, we both wanted to move to Utah. I applied for my first Utah-based job opportunity just before Christmas 2011. Several of my friends in the Salt Lake City area were kind enough to get me a few interviews here and there, but none of the opportunities were very serious. Probably about the time I wrote my last blog post, I was contacted by a recruiter in Boise. I would have loved to move back to Idaho, but my wife would have nothing to do with me if I did that. When I shared this information with the recruiter, he said he had a recruiter friend in the SLC area and that he'd pass … -
Web API and Metaprogramming
In the last week I hacked a little with the preview of Diablo 3 web API . My aim was to produce a simple python client. I started the old way, parsing the JSON data the service returned and building Classes for each element. Then I realized I wasn't doing it not pythonic nor DRY. So I started to build generic objects that could hold the data and take the shape of each element. The basic idea is -
django CMS 2.3 release candidate 2 available
django CMS 2.3 release candidate 2 available -
django CMS 2.3 release candidate 2 available