Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
OpenBlock Geocoder, Part 1: Data Model and Geocoding
As Tobias mentioned in Scraping Data and Web Standards, Caktus is collaborating with the UNC School of Journalism to help develop Open Rural (the code is on GitHub). Open Rural hopes to help rural newspapers in North Carolina leverage OpenBlock. This blog post is the first of several covering the internals of OpenBlock and, specifically, the ... -
OpenBlock Geocoder, Part 1: Data Model and Geocoding
As Tobias mentioned in Scraping Data and Web Standards, Caktus is collaborating with the UNC School of Journalism to help develop Open Rural (the code is on GitHub). Open Rural hopes to help rural newspapers in North Carolina leverage OpenBlock. This blog post is the first of several covering the internals of OpenBlock and, specifically, the geocoder. -
Released 0.6 final
We are happy to announce the first final release of LFS 0.6. Kudos to Michael Thornhill (of http://www.maithu.com/) who did a lot of work to make this happen. What's new? Using Django 1.3 Added country dependent addresses Added pluggable price calculation Added supplier management Massively improved management interface Improved static file handling (Django's staticfiles) Improved properties management Removed SWFUpload (Flash) in favour of jquery.fileupload (Javascript) Using Python's locale to display currencies New contact form Continues integration on shiningpanda Migration Starting with this release we provide a migration command (lfs_migrate, based on South) to upgrade your existing LFS instances. Please refer to the documentation for further information. What happens next? We have already started to plan and implement the next release of LFS. Some new features are: Product attachements Pluggable order number generation Using django_compressor New portlets: featured products, for sale products Aded SEO information for shop and pages Portets for pages Generic tax calculations Better pluggability See the roadmap for up-to-date information and follow the ongoing process on bitbucket. Further Information You can find more information and help on following places: Official page Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org Google Group lfsproject on Twitter IRC -
Update: JsLint Checker for Sublime Text 2 with jslint4java
Very important update of JsLint Checker Plugin for Sublime Text 2: I've moved execution of jslint4java (the tool which make lint checks) into separate thread so now plugin becoming usable for production/daily usage.Execution in separate thread is important difference from other *-lint plugins – you don't need to wait with blocked editor area until jslint finish the work. Now all of it will be done separately from main editor thread and you can continue to work.Next steps for this plugin are:Add support of Sublime Package ControlI want to add support of PyLint, PEP8 and PyFlakes supportCheck it out on GitHub -
My BaseModel
When I build projects in Django I like to have a 'core' app with all my common bits in it, including a BaseModel. In that BaseModel I'll define the most basic fields possible, in this case a simple pair of created/modified fields built using custom django-extension fields. # core/models.pyfrom django.db import modelsfrom django.utils.translation import ugettext_lazy as _from core.fields import CreationDateTimeField, ModificationDateTimeFieldclass BaseModel(models.Model): """ Base abstract base class to give creation and modified times """ created = CreationDateTimeField(_('created')) modified = ModificationDateTimeField(_('modified')) class Meta: abstract = TrueYou'll notice I also have core.fields defined. That is because (unless things have changed), django-extensions doesn't work with South out of the box. Hence the file below where I extend those fields to play nicely with my migration tool of choice.# core/fields.pyfrom django_extensions.db.fields import CreationDateTimeField, ModificationDateTimeFieldclass CreationDateTimeField(CreationDateTimeField): def south_field_triple(self): "Returns a suitable description of this field for South." # We'll just introspect ourselves, since we inherit. from south.modelsinspector import introspector field_class = "django.db.models.fields.DateTimeField" args, kwargs = introspector(self) return (field_class, args, kwargs) class ModificationDateTimeField(ModificationDateTimeField): def south_field_triple(self): "Returns a suitable description of this field for South." # We'll just introspect ourselves, since we inherit. from south.modelsinspector import introspector field_class = "django.db.models.fields.DateTimeField" args, kwargs = introspector(self) return (field_class, args, … -
Gedit as a Django IDE for Linux
gedit is actually a pretty bad ass IDE for Django web development. -
Authorize.Net Credit Card Form in Django
A Django form which submits a payment to Authorize.Net during form validation. -
Accept Credit Cards in Django with Authorize.Net
Accepting credit cards in your Django applications using the Authorize.Net payment gateway is easier than you might think. -
AJAX Form Submission in Django
Here is a simple example of using the jQuery javascript framework to hijack and submit a Django form. -
Django Dynamically Generated Images with Cairo
It is fairly simple to dynamically generate images in your Django views using the Cairo 2D graphics library. -
Django Authentication using an Email Address
A custom authentication backend which allows a user to login using their email address in Django. -
How to Add Django Database Caching in 5 Minutes
Milk my Caching for all it’s worth One of our big challenges at Yipit as an aggregator has been weaning ourselves off of all of those dastardly MySQL Joins. As Uncle Ben once warned Peter Parker, “With great power comes interminably long queries”. Fortunately, because our workload skews heavily towards reads, we’ve had success implementing various caching strategies across the stack. On the application level, we’ve leveraged Django’s built-in caching framework to enable site-wide caching for anonymous users, view level caching for authenticated pages (especially useful for our API), and ad-hoc caching for aggregate queries. Lately, we’ve begun to dive more deeply into the holy grail of Django data retrieval: cached QuerySets. Conveniently, there are a number of quality libraries available to facilitate this sort of thing, including Johnny Cache, Django Cache-Bot, and Django Cache Machine. We’ve decided to go with Cache Machine for the foreseeable future thanks to its dead simple integration, its common sensical handling of invalidation (including through Foreign Key relationships), useful ancillary features such as caching RawQuerySets and QuerySet counts, and its easy extensibility. A Quick Recap of How Cache Machine Works Cache Machine stores full model QuerySets as key value pairs in one of three … -
Made Up Statistics
At DjangoCon my good friend Miguel Araujo and I presented on Advanced Django Form Usage. Slide 18 of that talk mentioned some made up statistics. Here they are for reference:91% of Django projects use ModelForms.80% ModelForms require trivial logic.20% ModelForms require complex logic.Important Disclaimer: These numbers were cooked out of thin air by yours truly. I determined them with zero research, they carry absolutely not scientific weight, and shouldn't be used in any serious argument. They are wholly my opinion, which is good or bad depending on your point of view and your own opinion of my opinions.With that out of the way, I'm going to make a bar graph out of my fictional data:You'll notice that my bar titles could be stronger. I actually did that on purpose in case anyone tries to use that chart in real life. In any case, if you thought that was interesting, then read on. I have many more made-up statistics. For example, here are more numbers I've cooked up:Pydanny Made Up DevOps StatisticsDevOps is the new hotness. I know because every other Python meetup features someone speaking on it - just like every other Ruby, Perl, and PHP meetup. Anyway... numbers:24.3% Python developers … -
JsLint Checker for Sublime Text 2 with jslint4java
Just finished small JsLint Checker for Sublime Text 2. Configuration of two found on github packages was quite non-trivial from my point of view.I think that clean code is great improvement of development process and speed of development. Also JsLint is very good tool to avoid stupid errors like variables global scope leaks and so on.Check it out on github -
Code Month: Post Mortem
I had meant to post something on the first, but life got away from me in a crazy way. Last month, I talked about doing a Nanowrimo-style sprint-of-one for getting a website up. How'd that turn out? I didn't get the site up (otherwise, you would have had a joyous ... -
Deploying Django to Heroku
Heroku makes life easier for those web developers that just want to deploy our code and it work. In this screencast we walk you through creating a heroku app, deploying your actual code, and running south migrations. This will make development and deployment easier for everyone.Watch Now... -
Deploying Django to Heroku
Heroku makes life easier for those web developers that just want to deploy our code and it work. In this screencast we walk you through creating a heroku app, deploying your actual code, and running south migrations. This will make development and deployment easier for everyone.Watch Now... -
Deploying Django to Heroku
Heroku makes life easier for those web developers that just want to deploy our code and it work. In this screencast we walk you through creating a heroku app, deploying your actual code, and running south migrations. This will make development and deployment easier for everyone.Watch Now... -
The Story of Live-Noting
Like a lot of people, I've got this thing I do when I attend conferences, meetups, classes, and tutorials: I take notes. My open source based ones are mostly written in RestructuredText and I've kept in a particular folder since at least 2006.Putting notes in a DVCSOn September 13, 2009, I uploaded these notes to Github.com. I did that because I wasn't pleased with the workflow I established of moving items to Dropbox for backup. I use DVCS all the time and I figured why not just put my notes where I put my code? So I added my notes as a Github repo.DVCS Notes Based Management System?For a while I tried to use the Github folder README.rst trick to make a navigations system for my notes. But Github isn't designed for making a README into a dynamic custom content navigator, and it would make a silly feature request. I would rather the Github team work on Mercurial integration or other practical things before they honored a request to turn their system into my own custom Notes Management System. Eventually I just gave up on it and moved on.Sphinx + Read The Docs!In early July of 2011 I had a … -
Celery init scripts for Gentoo
I’m using django-celery on a project. The only difficult part was that gentoo ebuilds would not provide init scripts. It might be that some ebuilds in some obscure overlay provides those, but this was far too far away from the mainstream portage tree for me. Yes, the documentation about celery has some scripts using supervisord, [...] -
Django in Production: Part 2 - Background Tasks
This is the second part in a series about Django in Production. If you haven't already, read part 1 here. In my last post, I described in detail the core stack which powers a Django application in production. In this second part, I'll talk about something which has become commonplace in modern web applications - background tasks. Often websites perform complex tasks which take a long time to finish. These tasks don't always need to be done before the response is sent to the browser, so can be executed elsewhere. In cases like this, tasks can be performed asynchronously, by one or more "workers" which consume a task queue. Celery The most common task queue used with Django, at least in my experience, is called Celery. Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well. Celery isn't dependant on Django in any way - it's a completely separate application. It does, however, integrate extremely well with Django projects. By installing the django-celery package and then adding djcelery to the list of INSTALLED_APPS, Celery can be run and managed through Django itself - thanks to a set … -
How to contribute translations
Recently we have been asked how to contribute translations to LFS. There are two preferred ways: If your are a (Django-)developer you might want to fork django-lfs and django-lfstheme on bitbucket.org, add the translations as you used to, commit them and send us a pull request. If your are a translator you can just go to transifex, choose or add the language of your choice and start to translate via the web interface. Once you are ready we would add your translations to the source code. If none of these fit your workflow you can of course just send us the translation files :-) If you have further questions don't hesitate to get in touch on one of the following places: Official page Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org Google Group lfsproject on Twitter IRC -
Meta-blog about the blog
I’m going to go a little meta and discuss the aspects of this project behind the project itself. Why would someone want to blog every day? To educate those who don’t know what you do To learn more about a topic you already know – regardless of what you think of your knowledge you will be doing LOTS of research and experimentation along the way. To practice writing and communicating on technical topics. This isn’t easy, and I’ve been “writing” for a while. What does it take? Interest in the topic you’re writing about. A little (or lot!) knowledge helps too. Discipline – nearly every day there’s some degree of “meh I do NOT want to do this, or at least there was for me. Once I reached the 3/4 mark though it switched to “meh I do NOT want to do this, but I’m so dang close to succeeding!” Basic blog software. Like I said at the beginning of the month, my time was better spent writing content that taught than hacking on some blog I could then use. You’ll bikeshed the crap out of a blog you build yourself, don’t fall in this trap. My advice Take it … -
Getting to Continuous Deployment in Django: Feature Flipping
This post is a first in a series of posts about our move towards continuous deployment using Django. Continuous deployment is a process by which code that is written for an application is constantly deployed into production without manual intervention. This allows us to be agile, to quickly innovate, and more importantly, to bounce back from any grave errors, unscathed. When it comes to building new features, this can involve merging feature branches, rigorous code review, testing, and deployments, before you can test it out on a live environment. Every subsequent release to different groups of users would require code changes, and deployment. This can be avoided by employing feature flipping, which is an essential step towards achieving continuous deployment in your application. So what is this feature flipping thing, anyway? In its most basic form, you can think of it as applying an on/off switch to a piece of code in your codebase thereby releasing or rolling back a feature. This allows you to constantly push new code for features that you’re not quite ready to release to any of your users yet. And when you’re ready, you can do a gradual rollout of the feature – to various … -
Developers guide to Running Django Applications on Heroku
Heroku the platform as a service (PAAS) company, very popular in the Ruby on Rails community, has now started opening up their platform to languages besides Ruby. They now offer support for Python, Java, Clojure, Node.js, and Scala on their new Cedar stack. Heroku's Cedar stack is still in beta, but that shouldn't stop you from trying it out, and that is just what I'm going to do. 6 months ago I wrote a series of blog posts that reviewed all of the cool new django hosting services that were popping up. My goal was to look at them all, and compare them to find out what they had to offer, and to see if I could use them on my future projects. I'm going to review Heroku using the same process that I used to review those other services, so that I can we can compare apples to apples. For those of you who are not familiar with my other blog posts, feel free to check them out now ep.io, apphosted.com, gondor.io, dotcloud.com, DjangoZoom.com, Django hosting roundup. For those of you that are lazy, I'll sum it up pretty quickly. What I'm trying to do is pretty simple, I …