Code


Version 20 (modified by russellm, 4 years ago) (diff)

More elaboration

Google's Summer of Code 2010

Django is once again applying to be a sponsoring organization for the 2010 Google Summer of Code. (Read Google's page for more information on how the program works.)

Django's SoC program is being run by Jannis Leidel (jannis /at/ leidel /dot/ info).

Mentors

If you're interested in mentoring -- supervising a student in work on Django-related activities -- add your name and email here:

  • Jannis Leidel (jannis /at/ leidel /dot/ info)
  • Russell Keith-Magee (russell@…)
  • Ville Säävuori (ville@syneus dot fi)
  • Greg Wilson (gvwilson@…)
  • Your Name (Your Email)

Students

Student applications open March 29 and end on April 9.

If you'd like to get started on your proposal early, we'll be looking for a few things.

  • You'll need to have a concrete task in mind (some ideas are below) along with a solid idea of what will constitute "success" (you tell us).
  • If your proposal is a single large feature, you'll need to present a detailed design specification. This proposal should be posted to django-developers, where it can be refined until it is accepted by the developer community.
  • We'll want to know a bit about you -- links to previous work are great, if any. If you're proposing something ambitious, you'll need to convince us that you're up to the task.
  • You'll also need to provide us with a schedule, including a detailed work breakdown and major milestones so your mentor can know if and when to nag you :)

Note that none of the ideas below are good enough to be submissions in their own right (so don't copy and paste)! We'll want to know not just what you want to do but how you plan to pull it off.

Don't feel limited to the ideas below -- if you've got a cool project you want to work on, we'll probably be able to find you a mentor. We plan on approving as many projects as we possibly can.

Note: we're looking for projects that add value to Django itself - not application/CMS projects that use Django.

You should also note that as far as proposals go, we don't make a distinction between a GSoC project and any other proposal for a new feature. When you contribute code, you will be expected to adhere to the same contribution guidelines as any other code contributor. This means you will be expected to provide extensive tests and documentation for any feature you add, you will be expected to participate in discussion on django-developers when your topic of interest is raised. If you're not already familiar with Django's contribution guidelines, now would be a good time to read them.

Communication

The django-gsoc Google Group has been setup to facilitate communication between students and mentors in the GSoC efforts. This list should only be used for GSoC administrative matters. Any discussions on the specifics of a given proposal should be directed to django-developers.

Ideas

Here are some suggestions for projects students may want to propose (lazyweb: please add to this list!). This isn't by any means the be-all and end-all of ideas; please feel free to submit proposals for things not on this list. However, if you're going to propose something that isn't on this list, you might want to check on django-developers to see if there is any interest before you start drafting a full proposal.

When developing your proposal, try to scope ideas/proposals to the 4-month timeline -- simply proposing to fix a ticket or two will probably result in your proposal being rejected in favor of a more ambitious one. The GSoC does not cover activities other than coding, so certain ideas ("Write a more detailed tutorial" or "Create demonstration screencasts" or "Add a pony?") are not suitable for inclusion here.

On the other side, though, be sure to be concrete in your proposal. We'll want to know what your goals are, and how you plan to accomplish them.

In no particular order:

Template compilation

  • Complexity: High

A common criticism of Django's template language is that it is too slow. One reason for this is that the rendering process is handled at a very high level, interpreting a tree of tree nodes that have been generated by parsing the template source file.

Other Python-based template languages gain significant speedups by compiling templates directly to Python bytecode. A Django template compiler would allow for similar templating speedups.

Issues to consider:

  • How does Django's template variable scoping rules map to a compilation scheme?
  • Django Template tags are able to modify the context as the template is rendered. How does this affect the compilation process?
  • How should we handle the upgrade path when compiled templates are added to trunk?

See also:

Enhanced auth.user

  • Complexity: High

One of the most common class of questions on django-users surrounds issues of customizing Django's User model. For example:

  • How can I use an email address as a username?
  • I want to use Twitter/OAuth/Facebook to login - why can't I leave the username field empty?
  • How can I make the username field N characters longer/shorter?
  • How can I allow [insert random character] in usernames?
  • How can I have a single "name" field instead of "first_name"/"last_name"?

At present, there is no easy answer to these questions. Use of Django User model is not mandatory, but it is a dependency for a lot of Django applications. It is possible to do some of these customizations using some tricks or by manually modifying the contrib.auth source code, but these are not good solutions for novice users.

Ticket #3011 describes one approach that has been rejected - the idea of a 'pluggable' User model.

Note: This isn't a problem with an existing worked solution. A successful proposal on this project will require extensive discussion on django-developers.

Issues to consider:

  • How can we represent the generic idea of a User without reducing the user table to little more than an identifying primary key?
  • How can we differentiate the ideas of identity, permission and authentication?
  • How can we manage the dependencies that exist in contrib.admin (and other parts of Django core and Django.contrib) that rely on the internals of auth.User as currently implemented?
  • How can we roll out a new/modified User model without requiring almost every Django application on the planet to undergo a complex database modification?

See also:

  • #3011, and any discussion on django-developers that references it.
  • Discussions on django-users when users have asked the "how do I" questions
  • The [source:django/trunk/django/template django.contrib.auth code module]

Housekeeping

  • Complexity: Minor

Django has gone through three recent cycles of rapid change, culminating in the release of versions 1.0, 1.1 and 1.2. These releases have all been feature heavy, which is good for ticking off checkboxes on feature lists, but it does mean that some internal housekeeping and code cleanup tasks have been avoided in order to deliver new features. These housekeeping issues would be well suited to a Summer of Code student wishing to gain a deep understanding of the internal workings of the Django framework.

Issues to consider:

  • Django's Model._meta class is officially internal API, but in practice, many parts of _meta are in such common use that they couldn't be changed without causing major problems to Django users. The contents of _meta should be surveyed, cleaned up where necessary, documented and tested as part of formal API.
  • While the public API for foreign keys and m2m relations in Django is quite elegant, the implementation is anything but. This implementation should be cleaned up.
  • There are several internal components (such as the datastructures library) that are heavily used, but have not been extensively profiled to ensure that they are efficient. Profile the Django test suite to find the areas of code that are performance bottlenecks, and optimize them.

See also:

  • Trac, bugs by component. Any component with lots of bugs is potentially a candidate for inclusion in this project.
  • [source:django/trunk/django/db/models/options.py The Model._meta class definition]
  • [source:django/trunk/django/db/models/fields/related.py The related fields implementation]

Improved error reporting

  • Complexity: Medium

The error messages raised by Django can sometimes be confusing or misleading. This is sometimes due to Django wrapping and re-raising errors when it shouldn't. Sometimes it's due to Django not displaying error information effectively. Sometimes it's simply a matter of not catching the right errors.

This should be fixed. Error messages are just as important to the development process as good documentation. This project would address the error reporting issues in Django to ensure that the errors reported by a Django project are as good as they can be.

Issues to consider:

  • Import errors discovered during application loading during can be masked under certain circumstances.
  • Errors in template tags and filters rarely produce helpful error messages.
  • Errors in ModelForm and ModelAdmin can raise errors that don't indicate the real problem

See also:

Improve annotation and aggregation

  • Complexity: Medium

The 2009 Summer of Code added the annotate() and aggregate() calls to Django's query arsenal. While these tools work well for simple arithmetic aggregates, they don't work well for date and string based queries. There are also use cases where you may want to annotate data onto a model that *isn't* an aggregate (for example, annotating the sum of two other aggregates).

This project would continue where the 2009 GSoC aggregation project left off. This would be an excellent project for anyone wishing to gain an intimate understanding of Django's Query infrastructure.

Issues to consider:

  • String concatenation and manipulation (e.g., annotate a model with the uppercase version of the first 5 characters of someone's name)
  • Grouping of results by date (e.g., show me a count of articles, grouped by day)
  • Allowing non-null defaults in aggregation (e.g., when a model has no related objects, use 0 not NULL)
  • Aggregates involving generic relations

See also:

Customizable serialization

  • Complexity: Minor

Django's current serializer implementation imposes some restrictions that limit the usefulness of the serializers outside of fixture loading. The basic serialization format, for example, can't be changed.

The aim of this project would be to deliver a fully customizable serialization framework. Ideally, this would be a class-based structure that allows users to define their own serialization format (including different output structure, including non-model fields, etc). The end goal is that you should be able to output any object (or list of objects), in any format, to any depth, with any additional information that might be relevant in a serialization context.

In short, anywhere we have made an arbitrary design decision with Django's existing serializers, that decision should be customizable as an end user.

When developing your proposal, the proof of concept is that you should be able to define Django's existing serialization formats using your new serialization format.

Issues to consider:

  • Serializing nested structures (of arbitrary depth)
  • Serializing subsets of model attributes
  • Serializing non-database attributes/properties
  • Serialized output that doesn't match the current default output format (i.e., a model in JSON doesn't have to be {"pk": XX, "model": "myapp.foo", "fields": {...}} )
  • Serialized output format that can change on a per-model basis
  • Serialized output format that can change based on where in the output tree the object is located (e.g., output the full User object if it's included from within model X, but only output the username if its included from within model Y)
  • In an XML context, control over the tags, namespaces, attributes and nesting structures in the final XML
  • In a JSON/YAML context, control over the use of lists, dictionaries etc, as well as the choice of key names for dictionaries.

See also:

App loading

  • Complexity: Minor

Refactoring of the app loading mechanism (ref. #3591)

Issues to consider:

*

See also:

*

IPv6 support

  • Complexity: Minor

Django doesn't currently provide support for IPv6. This project would update Django to provide support for IPv6 wherever Django currently uses IPv4 addresses.

Issues to consider:

  • Can IPv6 support be added to model fields without adding a new field type?
  • Is there anywhere in the WSGI/FCGI interface where IPv6 issues exist, but are currently unreported
  • Can IPv6 support be added to configuration files (e.g., to specify memcache interfaces) in a transparent fashion?

See also:

Testing updates

  • Complexity: Minor

Django's test suite originally consisted almost entirely of doctests; these doctests were used as a supplement to the written documentation. Over time, this supplemental role has been dropped. The doctests have also gotten larger; in some cases (such as the queries regressiontest) they are now extremely unwieldly. New tests that are added to Django tend to be UnitTests when possible, but the existing legacy of doctests is hard to break in some cases.

There is also an artificial distinction between modeltests and regressiontests. In the past, this distiction was used to identify tests that served a documentation purpose; this role has long since disappeared, but the struture persists, leading to confusion over the 'right place' to test certain features represented in both directories.

These two tasks indicate a need to refactor Django's test suite. The aim of this project would be to update Django's test framework; migrating as doctests to UnitTests, and merging the modeltests and regressiontests directories.

Issues to consider:

  • How to maintain the integrity of Django's test suite? Django has spent a lot of effort building a strong regression test suite; how do we ensure that by refactoring the test suite, we don't lose the integrity of that regression set?
  • Is there any part of this process that can be automated? If so, How?
  • Will migrating from doctests to unittests cause any performance problems? Are there any ways to limit these performance problems?

See also: