Weblog

January archive

Django sprint in Kraków, Python

January 31, 2014

Pykonik, the Kraków Python User Group, would like to invite you to the 3rd Django Sprint in Kraków, Poland. We would like this event to become a winter tradition, so come and join us! This year we meet on the weekend of the 15th and 16th of February, in the brand new offices of Base, located at Wyczółkowskiego 7 in Kraków.

If you have never contributed to Django, don't worry, this is perfect occasion to start! You don't need to know Django itself and you can learn everything on the spot.

For those of you who earn money with Django, how about giving back to the community? What you learn might help you with your work. Besides, it's so fulfilling to finally squash that long lasting, annoying bug that has bothered you for a long time.

While the sprint itself is free, we kindly ask that you register at https://django-sprint-krk-2014.eventbrite.com — it will help us prepare the right amount of food and drinks. And don't forget to bring your laptop!

More details available at http://sprint.pykonik.org.

Django Update - 2014-01-12 to 2014-01-25

January 26, 2014

Overview

Has a lot happened in the last two weeks? You bet it has!

Notices

So, unless you've been asleep, you'll know that Django 1.7 alpha 1 was released!

This is a huge release with many big ticket items, as well as some smaller, but significant, ones.

Ticket Movement

Short lived tickets: 53

Tickets Created: 33

Open tickets: 1396 (-6)

Release Highlights

Migrations

Clearly, the biggest is Migrations. So long, South, you've served us so well...

App Loading

The App-loading refactor gives us many things we've longed for: predictable code initialisation sequence and order, a place to register our signals, a way to control the name and verbose name of apps in Admin...

Managers

Anyone who's used Django for long enough has probably wondered why Manager doesn't inherit from QuerySet, since it implements all the same methods.

Well, now there's QuerySet.as_manager. Anyone who uses django-model-utils is probably familiar with PassThroughManager for this same purpose.

Check it out

Russell Keith-Magee merged Christopher Medrela's 2013 Summer Of Code Project - a refactor of Validation into the new System Check Framework.

Prefetch

This is a personal favourite -- the Prefetch object gives you far more control over how prefetch_related works, including allowing you to pre-fetch filtered sets of related records, and even attach them to your instances on new properties.

Filters

This one snuck up on me, but we now have Custom Lookups and Custom Transforms.

And more...

There's heaps more in the release notes, more than I could possibly cover here. (There's even a few features by me!)

Did you know?

There's a 3rd positional argument in URL patterns. It's an optional dict of extra keyword arguments to pass to your view.

For example:

(r'^/foo/$', myview, {'bar': True}),

This would result in myview always being called with bar=True.

For more details, as always, read the docs.

Summary

PHEW Well, that's done now. We're in for a big few months preparing for the release of 1.7!

-- Have a better one!

Django sprint in Amsterdam, The Netherlands

January 23, 2014

We're very happy to announce that a two-day Django sprint will take place on February 22-23 in Amsterdam, Netherlands. This event is organized by the Dutch Django Association.

The venue is the office of TravelBird in the center of Amsterdam. The sprint will start on Saturday, February 22rd at 10:00 CET and and finish on Sunday, February 23 around 22:00 CET.

With the help of the Django Software Foundation and the Dutch Django Association we will have two core developers on site: Baptiste Mispelon and Daniele Procida. Daniele will also be doing his famed “Don’t be afraid to commit” workshop, which will take people new to contributing to Django through the entire contribution process with real tickets. So please don’t hesitate to join even if you’ve never contributed to Django before.

The first beta for Django 1.7 should come out shortly after the sprint, so we can still contribute bugfixes to it.

If you’re unable to come to Amsterdam, you're welcome to contribute to the sprint online. Sprinters and core developers will be available in the #django-sprint IRC channel on FreeNode.

We hope you can join us and help make the sprint as successful as possible!

DjangoCon Europe 2014 Call For Papers

January 23, 2014

The organizers of DjangoCon Europe 2014 are pleased to invite all members of the Django community to submit their talk proposals for the conference. We’re looking for Django and Python enthusiasts, pioneers, adventurers and anyone else who would like to share their Django achievements and experiments with the rest of the community.

Submissions close on February 1. For more information, please read the announcement on the DjangoCon Europe website.

Django 1.7 alpha 1 released

January 22, 2014

As part of the Django 1.7 release process, today we've released Django 1.7 alpha 1, a preview/testing package that represents the first stage in the 1.7 release cycle and an opportunity for you to try out some of the changes coming in Django 1.7.

Django 1.7 will bring several major new features to Django, along with a host of other improvements. Highlights include a schema-migration framework, a new validation tool to help identify and fix common errors, a complete refactoring of how Django identifies and loads applications, and support for custom database lookups.

For full details, see the in-development 1.7 release notes.

As with all alpha and beta packages, this is not for production use. But if you'd like to take some of the new features for a spin, or to help find and fix bugs (which should be reported to the issue tracker), you can grab a copy of the alpha package from our downloads page. And as always, signed MD5 and SHA1 checksums of the 1.7 alpha package are available.

In addition to the changes covered in the release notes, there are two already-noted issues to be aware of when using the 1.7 alpha package:

  • Issue #21856 -- an empty value for the DATABASES setting will cause a crash.
  • Issue #21831 -- using the contenttypes package or GenericForeignKey will fail unless django.contrib.auth is in INSTALLED_APPS.

Both of these will be fixed prior to the final 1.7 release.

Additionally, users of South (a popular third-party package for schema migrations) should note that South is not compatible with the 1.7 alpha.

Django Update - 2013-12-29 to 2014-01-11

January 12, 2014

Overview

All recovered from the new years period? Brains back online? Good! Let's get to it!

I've been getting some positive feedback from people about these, so it's nice to know I'm making a difference :)

Ticket Movement

Short lived tickets: 30

Tickets Created: 32

Open tickets: 1400 (+9)

Projects

App Loading reloaded

This has been making great headway, and causing a lot of discussion on the dev mailing list.

This work has focused on changing how we think about INSTALLED_APPS.

Another thing uncovered was that Django was being forgiving for people with overlapping import paths. This was something very common before the project layout fixes in Django 1.4.

Why are they bad? Because Python sees them as two distinct modules -- meaning it will import them twice. This means your signals will register twice, if you're not careful.

Sure, there's machinery in there to help cure that problem, but prevention is better than cure. If we have a choice. why allow the condition that requires the cure?

Using setuptools

The idea of using setuptools to make django-admin.py runnable on Windows (#21340) has been brought up again.

After discussion on IRC, the following was decided (as posted by Florian Apolloner):

  • We are not going to support setuptools and distutils, this makes the setupprocess difficult to debug and test imo.
  • Given Donald's "okay" we might switch to setuptools completely
  • There seems to be a bug in pip when installing a wheel, which renders the django-admin.exe unusable on windows, help welcome
  • PR for this issue is now at https://github.com/django/django/pull/2116

Did you know?

As of 1.6, Django supports persistend DB connections. They're disabled by default, and can be enabled per-DB in your DATABASES setting.

Turning this on can save you some time at the beginning of every request. The time varies, depending on which DBMS, if you're using SSL, and the latency between your DB server and app servers, but I've seen measurements between 25ms and 450ms.

For more details see the docs.

Summary

Well, these are getting easier now.

-- Have a better one.