http://djangodose.com Django Dose Everything Feed Django Dose Community Catchup - Episode #23: 07/27/2010 http://djangodose.com/podcasts/community-catchup/episode/23/ Django Dose Community Catchup - Episode #23: 07/27/2010 2010-07-27T23:04:08Z 2010-07-27T23:04:08Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/22/ Django Dose Community Catchup - Episode #22: 07/09/2010 2010-07-09T19:00:57Z 2010-07-09T19:00:57Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/21/ Django Dose Community Catchup - Episode #21: 07/02/2010 2010-07-02T02:03:03Z 2010-07-02T02:03:03Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/20/ Django Dose Community Catchup - Episode #20: 06/16/2010 2010-06-16T00:20:08Z 2010-06-16T00:20:08Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/19/ Django Dose Community Catchup - Episode #19: 05/20/2010 2010-05-20T23:09:21Z 2010-05-20T23:09:21Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/18/ Django Dose Community Catchup - Episode #18: 05/16/2010 2010-05-16T19:15:44Z 2010-05-16T19:15:44Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/17/ Django Dose Community Catchup - Episode #17: 04/30/2010 2010-04-30T06:00:00Z 2010-04-30T06:00:00Z Django Dose http://djangodose.com/podcasts/callcast/episode/11/ Django Dose Callcast - Episode #11: 04/20/2010 2010-04-20T06:00:00Z 2010-04-20T06:00:00Z Django Dose

A panel involving Mike Malone, Waldemar Kornewald, Adam Lowry, Ted Nyman, Jacob Kaplan-Moss, Eric Florenzano, and Alex Gaynor on NoSQL and Django.

http://djangodose.com/podcasts/community-catchup/episode/16/ Django Dose Community Catchup - Episode #16: 04/15/2010 2010-04-14T21:10:40Z 2010-04-14T21:10:40Z Django Dose http://djangodose.com/blog/2010/04/nosql-panel/ NoSQL Panel 2010-04-15T09:07:20Z 2010-04-11T16:35:51Z Alex Gaynor

We're pleased to announce that DjangoDose will be bringing you another exciting panel. This time our topic will be NoSQL and Django, and our guests will be:

We're also hoping to have someone representing CouchDB, but we don't know who it will be yet, we'll let you know when we do.

Like last time we've set up a Google Moderator for the panel, and we hope you'll submit and vote on questions that are interesting to you.

http://djangodose.com/podcasts/community-catchup/episode/15/ Django Dose Community Catchup - Episode #15: 04/11/2010 2010-04-11T06:00:00Z 2010-04-11T06:00:00Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/14/ Django Dose Community Catchup - Episode #14: 04/08/2010 2010-04-08T06:00:00Z 2010-04-08T06:00:00Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/13/ Django Dose Community Catchup - Episode #13: 04/04/2010 2010-04-04T22:27:50Z 2010-04-04T22:27:50Z Django Dose http://djangodose.com/bookmarks/2010/feb/23/dajax-project-ajax-your-django-project/ DAjax Project - Ajax for your Django Project 2010-02-23T10:13:08Z 2010-02-23T10:13:08Z Kevin Fricovsky Describe as "a powerfull tool to easily and super-fastly develop asynchronous presentation logic in web applications using python and almost no lines of JS source code." DAjax currently supports up to four of the most popular JS frameworks: Prototype, jQuery, Dojo and mootols. The project site has some examples and links to documentation which is hosted over on the Github repository -http://github.com/jorgebastida/django-dajax http://djangodose.com/bookmarks/2010/feb/22/quick-admin-docs-simpleadmindoc/ Quick Admin Docs with Simpleadmindoc 2010-02-22T09:31:18Z 2010-02-22T09:31:18Z Kevin Fricovsky Simpleadmindoc is django application that allows you to quickly create help for modules in Django admin. Goal is to be flexible enough, fast to create and easy to integrate. http://djangodose.com/bookmarks/2010/feb/22/4-things-know-nosql-django-coders/ 4 things to know for NoSQL Django coders 2010-02-22T07:44:11Z 2010-02-22T07:44:11Z Kevin Fricovsky Waldemar Kornewald discusses his new project django-nonrel which is a port of Django with the goal of supporting non-relational databases. Currently it provides an App Engine backend; work has begun on MongoDB support as well. http://djangodose.com/bookmarks/2010/feb/19/message-queues-django-and-celery-quick-start/ Message Queues, Django and Celery Quick Start 2010-02-19T14:21:57Z 2010-02-19T14:21:57Z Kevin Fricovsky Rich Leland discusses how the team at Discovery.com handles image uploading and their post processing flow, and walks through a quick start in getting your hands dirty with message queues, Django, and Celery. http://djangodose.com/bookmarks/2010/feb/15/efficient-generic-relations/ Efficient generic relations 2010-02-15T13:11:23Z 2010-02-15T13:11:23Z Kevin Fricovsky Daniel Roseman discusses his solution for optimizing generic relationships. http://djangodose.com/bookmarks/2010/feb/8/django-advent-launches/ Django Advent Launches 2010-02-08T06:43:36Z 2010-02-08T06:43:36Z Kevin Fricovsky If 24ways.org is "the advent calendar for web geeks" then DjangoAdvent is the advent calendar for Django geeks. Inspired by the many 'advent calendar' websites out there, DjangoAdvent is a series of articles about upcoming releases of the Django web framework. Right now it looks like there are 12 articles in the queue but I believe more may be coming. Excellent work Rob Hudson and Idan Gazit. http://djangodose.com/bookmarks/2010/jan/30/django-voice-community-feedback-app/ Django-Voice community feedback app 2010-01-30T18:30:51Z 2010-01-30T18:30:51Z Kevin Fricovsky Django-Voice is community feedback application ala UserVoice and GetSatisfaction.It was originally built for VerbApp (http://verbapp.com/) and the templates looks really nice. Tipped by Ross Poulton, thanks Ross. http://djangodose.com/bookmarks/2010/jan/27/evaluating-django-caching-options/ Evaluating Django Caching Options 2010-01-27T12:23:08Z 2010-01-27T12:23:08Z Kevin Fricovsky Cody Soyland discussing the many caching options available to you as a Django developer and provides some benchmarks using his current deployment stack... "Caching is one of the first things you can do when you need to start thinking about scaling. Among efforts such as query minimization, denormalization, code optimizations, compression, database tuning, indexing, and load balancing, caching remains one of the lowest hanging fruits in methods to lighten your server load and handle huge amounts of traffic." http://djangodose.com/bookmarks/2010/jan/27/reliably-saving-urls-file-field/ Reliably saving URLs to a file field 2010-01-27T07:16:06Z 2010-01-27T07:16:06Z Kevin Fricovsky Chris Adams saves you the trouble if you're looking to easily save a remote file locally via HTTP by using Django's NamedTemporaryFile and urllib2. http://djangodose.com/podcasts/community-catchup/episode/11/ Django Dose Community Catchup - Episode #11: 01/20/2010 2010-01-20T09:00:00Z 2010-01-20T09:00:00Z Django Dose http://djangodose.com/podcasts/tracking-trunk/episode/8/ Django Dose Tracking Trunk - Episode #8: 01/20/2010 2010-01-20T09:00:00Z 2010-01-20T09:00:00Z Django Dose http://djangodose.com/podcasts/tracking-trunk/episode/7/ Django Dose Tracking Trunk - Episode #7: 12/15/2012 2010-01-08T12:26:42Z 2010-01-08T12:26:42Z Django Dose http://djangodose.com/bookmarks/2010/jan/8/authentication-agains-google-apps-domains-django/ Authentication agains Google Apps Domains for Django 2010-01-08T05:39:31Z 2010-01-08T05:39:31Z Kevin Fricovsky Interesting idea. From the author: "googleappsauth allows you to authenticate your Django users against an Google Apps domain. This means you basically get a single sign-on solution, provided that all users of your django application also have Accounts in Google Apps for your Domain." http://djangodose.com/bookmarks/2010/jan/7/dynamic-translation-apps-django/ Dynamic Translation Apps for Django 2010-01-07T06:56:23Z 2010-01-07T06:56:23Z Kevin Fricovsky Having gone through similar research myself it's nice to see someone publish a round up all the available Django apps that help manage multilingual content. The author provided a brief, yet critical review of each app. Good read. http://djangodose.com/bookmarks/2009/dec/21/restful-web-apps-django-piston-and-ext-js/ RESTful Web apps with Django, Piston and Ext JS 2009-12-21T07:06:01Z 2009-12-21T07:06:01Z Kevin Fricovsky In this thorough post, Matt Dorn works you through integrating Django-Piston in your already existing Django project as well as wiring up your RESTful results with an Ext JS widget. He also details extending Piston by creating your own custom emitter. http://djangodose.com/podcasts/tracking-trunk/episode/6/ Django Dose Tracking Trunk - Episode #6: 11/29/2012 2009-12-02T13:49:13Z 2009-12-02T13:49:13Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/9/ Django Dose Community Catchup - Episode #9: 11/30/2012 2009-12-02T13:48:35Z 2009-12-02T13:48:35Z Django Dose http://djangodose.com/podcasts/tracking-trunk/episode/5/ Django Dose Tracking Trunk - Episode #5: 11/11/2009 2009-11-19T04:00:00Z 2009-11-19T04:00:00Z Django Dose

Apologizes for the soft static noise on the podcast. Alex's new mic needs some more tweaking. We're working on it.

http://djangodose.com/podcasts/community-catchup/episode/8/ Django Dose Community Catchup - Episode #8: 11/11/2009 2009-11-19T04:00:00Z 2009-11-19T04:00:00Z Django Dose

Apologizes for the soft static noise on the podcast. Alex's new mic needs some more tweaking. We're working on it.

http://djangodose.com/podcasts/tracking-trunk/episode/4/ Django Dose Tracking Trunk - Episode #4: 11/05/2009 2009-11-05T06:00:00Z 2009-11-05T06:00:00Z Django Dose http://djangodose.com/podcasts/community-catchup/episode/7/ Django Dose Community Catchup - Episode #7: 11/04/2009 2009-11-04T06:00:00Z 2009-11-04T06:00:00Z Django Dose http://djangodose.com/podcasts/tracking-trunk/episode/3/ Django Dose Tracking Trunk - Episode #3: 10/28/2009 2009-10-28T10:00:00Z 2009-10-28T10:00:00Z Django Dose
  • r11623
    • Made the auth context processor lazy
  • r11639
    • Comment moderation via admin actions
  • r11646
    • exists() method for QuerySets
http://djangodose.com/podcasts/community-catchup/episode/6/ Django Dose Community Catchup - Episode #6: 10/28/2009 2009-10-28T10:00:00Z 2009-10-28T10:00:00Z Django Dose http://djangodose.com/podcasts/callcast/episode/10/ Django Dose Callcast - Episode #10: 10/21/2009 2009-10-21T06:00:00Z 2009-10-21T06:00:00Z Django Dose

A panel involving Brian Rosner, Eric Florenzano, Alex Gaynor, James Tauber, Jannis Leidel, Kevin Fricovsky and James Bennett on reusable apps in Django. Or shall we say, well-written code that happens to be reusable.

http://djangodose.com/podcasts/community-catchup/episode/5/ Django Dose Community Catchup - Episode #5: 10/20/2009 2009-10-20T18:00:00Z 2009-10-20T18:00:00Z Django Dose http://djangodose.com/bookmarks/2009/oct/20/jogging-easier-django-logging/ Jogging - Easier Django Logging 2009-10-20T12:07:31Z 2009-10-20T12:07:31Z Kevin Fricovsky Zain Memon was inspired by all the logging discussions lately in the Django community, so he wrote a wrapper for Python's logging module called Jogging (pronounced "yogging"). The idea took inspiration from the ongoing discussion found in the Django developers google group "Proposal for 1.2: built-in logging with django.core.log". Zain would love your thoughts on whether this approach is viable for 1.2 or if jogging is better off as an app on pypi. And yes we need to add markup to these posts so links are hyperlinked, etc. Sorry about that. http://djangodose.com/podcasts/community-catchup/episode/4/ Django Dose Community Catchup - Episode #4: 10/15/2009 2009-10-15T06:00:00Z 2009-10-15T06:00:00Z Django Dose http://djangodose.com/blog/2009/10/reusable-application-panel/ Reusable Application Panel 2009-10-21T09:00:51Z 2009-10-13T13:02:08Z Alex Gaynor

We're happy to announce that this week we'll be recording a panel all about reusable applications. We're very happy to say that James Tauber, James Bennett, Kevin Fricovsky, and Jannis Leidel will be joining Brian, Eric, and me in bringing this to you. We want this to be about both the philosphical design points on reusable applications, as well as about the practical everyday issues developers face when working with and developing reusable applications. Most of all, we want to talk about the issues that matter to the community. To that end we've set up a Google moderator where you can voice your own opinions on what you want us to talk about. You can find that here (keep in mind you don't need to have specific questions, you can simply vote on the ones you like best).

Finally, I want to say that this type of content is the kind of thing we're very excited to be doing with DjangoDose. With the rebranding of This Week in Django as DjangoDose we've got a great opportunity to be doing this kind of discussion that doesn't necessarily fit the format of a weekly podcast. If you've got any idea for content, whether it's a roundtable discussion like this, or an article, please let us know using our contact form.

http://djangodose.com/podcasts/tracking-trunk/episode/2/ Django Dose Tracking Trunk - Episode #2: 10/13/2009 2009-10-13T06:00:00Z 2009-10-13T06:00:00Z Django Dose http://djangodose.com/bookmarks/2009/oct/7/knight-foundation-fund-plug-and-play-version-every/ Knight Foundation to Fund Plug-and-Play Version of EveryBlock 2009-10-07T06:58:48Z 2009-10-07T06:58:48Z Kevin Fricovsky An interesting idea to continue the efforts behind the popular, open source EveryBlock application (view source on github) which was acquired by MSNBC recently. Pull quotes: "We don't want to be doing something that just benefits big news organizations," Kebbel said. "We want something that anyone can benefit from." The Knight Foundation is working with advisers at the Massachusetts Institute of Technology to form a team to further development of EveryBlock and make it much easier for news organizations to set up the software on their sites, Kebbel said. http://djangodose.com/podcasts/community-catchup/episode/3/ Django Dose Community Catchup - Episode #3: 10/07/2009 2009-10-07T06:00:00Z 2009-10-07T06:00:00Z Django Dose http://djangodose.com/bookmarks/2009/oct/5/django-lean/ Django-lean 2009-10-05T11:43:02Z 2009-10-05T11:43:02Z Kevin Fricovsky A framework for performing and analyzing split-test experiments in Django applications. Django-lean aims to be a collection of tools for startups using the Django platform. Currently it provides a framework for implementing split-test experiments in JavaScript, Python, or Django template code along with administrative views for analyzing the results of those experiments. http://djangodose.com/bookmarks/2009/oct/2/washington-posts-new-post-alert-powered-django/ Washington Post's new 'Post Alert' powered by Django 2009-10-02T06:25:46Z 2009-10-02T06:25:46Z Kevin Fricovsky The Washington post's new alert feature is powered by Django. Here's a pull from the story - "Jesse Foltz, the front-end developer of the project, wrote the Post Alerts in JavaScript, using the Prototype and MooTools libraries. The back-end, which was built by Lee Trout, is a Django admin where editors can schedule Alerts." http://djangodose.com/podcasts/community-catchup/episode/2/ Django Dose Community Catchup - Episode #2: 09/30/2009 2009-09-28T06:00:00Z 2009-09-28T06:00:00Z Django Dose
  • We held our own minisprint to fix up the website a bit & submit to iTunes.
http://djangodose.com/bookmarks/2009/sep/27/django-piston/ Django-Piston 2009-09-27T16:49:12Z 2009-09-27T16:49:12Z Eric Florenzano Django-Piston is an interesting new project that has come out of [[http://bitbucket.org/|BitBucket]] which lets you easily create programmatic RESTful APIs for your Django website. If you need to build an API, you should check this out. http://djangodose.com/podcasts/community-catchup/episode/1/ Django Dose Community Catchup - Episode #1: 09/23/2009 2009-09-23T06:00:00Z 2009-09-23T06:00:00Z Django Dose http://djangodose.com/podcasts/tracking-trunk/episode/1/ Django Dose Tracking Trunk - Episode #1: 09/21/2009 2009-09-21T06:00:00Z 2009-09-21T06:00:00Z Django Dose
  • r11494 and r11495
    • Micro-optimizations to SortedDict that showed massive time savings on the test suite
    • Jacob Kaplan Moss
  • r11526
    • Massive improvements to the bash completion
    • Joseph Kocherhans, patch by Arthur Koziel
  • Moved all completed or dead branches into the attic directory
  • Branched for 1.1.X
  • A whole host of other small fixes
  • On the mailing list began planning for merge of the SOC branches
http://djangodose.com/articles/2009/09/introduction-aggregates-django/ Introduction to Aggregates in Django 2009-09-08T23:49:16Z 2009-09-11T22:00:00Z Alex Gaynor

With the 1.1 release of Django came several major new features, prominent among these is aggregation, which was among the most oft-requested for Django's ORM. The addition and manner of implementation of this feature highlights several fundamental philosophies within Django, as well as provides new possibilities. Fundamentally aggregates support in Django means a way to answer queries such as "show me all the authors who have published more than 1 book" or "show me the most expensive book".

One of the most important things to understanding how the aggregates API works is to understand that Django's ORM does not try to replace SQL, or provide an API to SQL in Python. The purpose of Django's ORM is to represent some persistent datastore, and have a way to put objects in and get them out. As such nothing in the API is SQL specific, and you will never see a discussion of how to get a GROUP BY or HAVING clause in your query. Instead the discussion around aggregates is centered around answering two different kinds kinds of questions, one is "What is the maximal[or minimal, or average, or count, etc.] value of some field in this group of objects", the other is "For each of the objects in this group, what is the maximal[or minimal, or average, or count, etc.] of some other group of objects that is related". We can think of these types of queries in terms of what they return, the first returns a scalar value, while the second returns a group of objects(in our case a QuerySet) that carry with them some additional information. In the case of the second type of query, since all that additional data exists in our backend we can do all the type of operations we would expect, such as further filtering, ordering, or even computing another aggregate over those values.

Let's consider the first type of query, since they are slightly simpler. For the purpose of our examples we are going to work with two models:

from django.db import models

class Author(models.Model):
    name = models.CharField(max_length=100)

    def __unicode__(self):
        return self.name

class Book(models.Model):
    authors = models.ManyToManyField(Author)
    title = models.CharField(max_length=200)
    price = models.DecimalField(decimal_places=2, max_digits=6)

    def __unicode__(self):
        return self.title

These are two relatively simple models with which we can demonstrate most of the features of aggregation. For example, a simpler query might be how much does the most expensive book cost?:

>>> from django.db.models import Max
>>> Book.objects.aggregate(max_price=Max('price'))
{'max_price': Decimal('56.49')}

There are a few important things to note here. First, aggregate() is a sentinel method on a QuerySet, that means that unlike a lot of other methods on a Queryset you can't chain more methods afterwords. Secondly, aggregate() returns a dictionary, mapping the alias provided in aggregate to the result value. Aggregates itself takes any number of keyword arguments with the keyword being the alias, and the value being the aggregate itself. You can also give aggregate positional arguments, in which case the alias is a default one constructed based on what field is being aggregated on, and what type of aggregate is being preformed.

Out of the box Django provide's support for seven types of aggregates, sum, maximum, minimum, average, count, standard deviation, and variance. It is also possible to create your own aggregation classes, which modules like GeoDjango (django.contrib.gis) take advantage of. Each aggregate class is instantiated with a string that refers to the field the aggregation should be preformed over, with full support for the "__" syntax to refer to related fields, as seen elsewhere in Django's ORM.

The second type of query we can do preform operations for each item in the QuerySet. So for example we might ask how many author's each book has:

>>> from django.db.models import Count, Max
>>> books = Book.objects.annotate(num_authors=Count('authors'))
>>> books
[<Book: Pro Django>, <Book: Practical Django Projects>, <Book: The
Definitive Guide to Django>]
>>> [book.num_authors for book in books]
[1, 1, 2]

We might only want books that have more than one author::

>>> Book.objects.annotate(num_authors=Count('authors')).filter(num_authors__gt=1)
[<Book: The Definitive Guide to Django>]

Or we might want to know what the greatest number of authors any book has::

>>> Book.objects.annotate(num_authors=Count('authors')).aggregate(max_authors=Max('num_authors'))
2

There are several features that distinguish the annotate() method from aggregate() one. First, it returns another QuerySet, second, each object it returns is a normal Model instance, except it has extra attributes corresponding to the aggregates were requested. However, like the aggregate() method it takes any amount of keyword or positional arguments which are handled in the same way. The QuerySet can be further manipulated, but fundamentally what annotate() does is give us access to an extra value on each object.

Strictly speaking these were all computations that we could have solved before in pure Python, however there are a number of distinct advantages to doing these at the datastore level. First, it's going to be faster, compared to our datastore Python is going to be very slow to do these calculations, our datastore is built to do these computations with large numbers of records, so we should let it do its job, second, it saves bandwidth, to do a calculations like preform an annotate, sort by its result, and take a subset of that data in Python we would need to pull in every single record, depending on the size of our dataset this could mean pulling in millions of records, which is unfeasable.

The important point to take away is that when trying to figure out how to write a query using the Django ORM it is most important not to think of the query in terms of what the SQL would look like, but instead in terms of what question are we trying to answer, and from there try to figure out what aggregations or annotations we need, and what filtering or ordering we need to preform, and what slicing we need to do. By following these steps it becomes much easier to put together queries that answer the questions that we need answered.

http://djangodose.com/podcasts/tracking-trunk/episode/0/ Django Dose Tracking Trunk - Episode #0: 09/08/2009 2009-09-06T22:29:36Z 2009-09-06T22:29:36Z Django Dose

It's been a long time since the last episode of This Week in Django, where we had our last Tracking Trunk segment. In this episode, we talk about what we envision the Tracking Trunk of Django Dose will look like. We also talk about some of the history and a little about why the format is different from how it used to be.

http://djangodose.com/articles/2009/09/handling-development-staging-and-production-enviro/ Handling Development, Staging, and Production Environments 2009-09-06T11:20:32Z 2009-09-06T09:20:28Z Eric Florenzano

When you're developing a personal website, a blog, or a website for a small client, you typically don't spend a whole lot of time worrying about setting up dedicated development, staging, and production environments. When that small client becomes bigger, your personal website becomes a brand, or you accidentally release broken code, that's when it makes sense to start separating out those environments.

From a server standpoint, it's fairly straightforward on how to set up development and staging environments: You either buy new servers, set up virtual servers, or change the configuration on existing servers to deploy a different checkout of your Django project. Essentially whatever you did to deploy your project to production, you do that same process again to prepare the server for development and staging environments.

The more interesting question for our purposes is how to deal with these new environments from the Django side. The solution that I use is simple: an environment variable and some settings overrides files. Here's the code that I put at the bottom of my settings.py file to make it all work:

import sys
import os

FLAVOR = os.environ.get('FLAVOR', 'localdev')

def override_settings(dottedpath):
    try:
        _m = __import__(dottedpath, fromlist=[None])
    except ImportError:
        pass
    else:
        _thismodule = sys.modules[__name__]
    for _k in dir(_m):
        setattr(_thismodule, _k, getattr(_m, _k))

override_settings('settings_overrides.' + FLAVOR) override_settings('local_settings')

There's a lot packed into this small snippet of code. Firstly, the FLAVOR setting is what determines which type of environment we want to run. As you can see, it defaults to localdev which is for the case where you're developing on your local machine. You can set this environment variable to whatever you want. Typical values for FLAVOR include "dev", "staging", "prod", and "test".

The next part of this snippet is the override_settings function. It takes a dotted path to a settings file and imports everything in that file into the current settings file. If there are duplicate settings, the one from the override_settings function wins. As you can see, the settings from e.g. 'settings_overrides.staging' are imported, according to the current FLAVOR, and then finally local settings are imported if they are found.

As an example of how this all would work, here's how the directory structure could look:

settings.py
settings_overrides/
    dev.py
    staging.py
    prod.py
    test.py

Now that we have this setup, we can simply set this environment variable before running any manage.py commands:

FLAVOR=dev python manage.py syncdb

The above would run syncdb on the development database (the DATABASE_* options from settings_overrides/dev.py). You can also use the export command to set the environment variable for the rest of the terminal session:

export FLAVOR=dev python manage.py cleanup
python manage.py syncdb

Also it's easy to set the environment variable using the os.environ dictionary, so if you're using mod_wsgi and Apache, you might have a production wsgi file that looked something like this:

import os

import django.core.handlers.wsgi

os.environ['FLAVOR'] = 'prod'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

application = django.core.handlers.wsgi.WSGIHandler()

Using this technique is simple, straightforward, and an effective way of splitting out development, staging, and production environments for Django. It makes it easy to keep the settings isolated and cleanly separated. Watch out though, because sometimes it can be easy to forget what your FLAVOR environment variable is set to!

How do you manage development, staging, and production environments? Share your tips and tricks in the comments below.

http://djangodose.com/blog/2009/09/welcome-django-dose/ Welcome to Django Dose 2009-09-09T15:59:32Z 2009-09-06T09:07:21Z Brian Rosner

We are pleased to announce that Django Dose, a Django content site, is now online! We couldn't be more happy that we have the terrific DjangoCon conference to launch this new site. If you're familiar with This Week in Django, you may notice some similarities, and with good reason--Django Dose is the successor to TWiD. It has only taken us way too long to get Django Dose up and running. One of our goals with Django Dose was to completely revamp the internals of the site. We wanted to add much more automation to the process which will help streamline content and make it easier for us to get you all of your Django-related content. We still have a little more ways to go, but we think we're off to a great start.

Changes

This Week in Django had the fundamental problem of being tied to a weekly format. While we don't want to change that drastically we felt we needed some change. One of the big things we've changed is that we've broken the podcast into two. We now have Tracking Trunk and Community Catchup. The reason for this was that the two couldn't co-exist very well. There would be weeks where there would be either no changes or simply documentation commits. Those didn't bode well for a weekly podcast that tried to keep the content going. We hated having to not do the tracking trunk segment because there wasn't any commits. Breaking it off now gives us the ability to record/produce the podcast when important content is available.

In addition to breaking off tracking trunk and community catchup we decided to make the callcasts a bigger part of our site. They are now a team effort and we hope to keep them coming. As the site matures and grows, we expect that it won't just stay limited to Tracking Trunk, Community Catchup, and Callcasts. But we can't do it all alone! It is our profound hope that with Django Dose, more people in the community will get involved. If you've got a great idea for an article, audio content, or video content, don't hesitate to drop us a line. We also love guest authors, so we may contact you to ask permission to re-post your great articles on Django Dose, where hopefully they can reach a larger audience.

An obvious change has been the site design. With a new brand we wanted to brand it differently. Greg Newman graciously stepped up to help us out. We can not thank him enough for the work he has put in to making Django Dose look good and work well. The site has been tweaked a bit to feature the content we feel is important.

Finally

We've enjoyed DjangoCon so far and we hope you have too! We're really looking forward to hearing back from you about this new version of the site, so if you're at DjangoCon, then make sure to grab us and tell us about your ideas. Oh, and make sure to subscribe, so you can get the latest Django Dose content!

http://djangodose.com/podcasts/callcast/episode/9/ Django Dose Callcast - Episode #9: 09/05/2009 2009-09-05T15:40:55Z 2009-09-05T15:40:55Z Django Dose

Alex Gaynor has been contributing more and more to Django and its community. This summer, he even worked as a student in Google Summer of Code to implement Multiple Database support for Django. We finally got a chance to catch up with him and talk to him about his involvement with Django, his work on Multiple Databases, and more.

http://djangodose.com/podcasts/community-catchup/episode/0/ Django Dose Community Catchup - Episode #0: 09/08/2009 2009-09-05T10:51:33Z 2009-09-05T10:51:33Z Django Dose

An introduction to what Django Dose is and what will be in the future. We talk about the impetus for changing formats from that of This Week in Django, into what it is today. We also talk about our hopes for the podcast as it evolves and grows. We also ask for your feedback and input on a variety of topics. We're very pleased to have the opportunity to bring Django content to you, but we can't do it without your input. Please let us know what you think about this new format in the comments and as feedback to us.