[tracker] upgrade to django 1.6



5 years ago
5 years ago


(Reporter: rrosario, Assigned: rrosario)


Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: u=dev c=general p=3 s=2014.6)



5 years ago
Django 1.6 has been out for a while. We should upgrade. Srsly.

Note: It's likely this bug will spin off a bunch of other bugs for upgrading vendor libs and/or swapping them out for other libs.

NOTE: description and title stolen from bug 889467


5 years ago
Depends on: 972522
Django 1.6 has a bunch of optimization wins in it. James said when we switch, it'll be noticeable.

For example, these:

*Improved transaction management*

Django’s transaction management was overhauled. Database-level autocommit is now turned on by default. This makes transaction handling more explicit and should improve performance. The existing APIs were deprecated, and new APIs were introduced, as described in the transaction management docs.

Please review carefully the list of known backwards-incompatibilities to determine if you need to make changes in your code.

*Persistent database connections*

Django now supports reusing the same database connection for several requests. This avoids the overhead of re-establishing a connection at the beginning of each request. For backwards compatibility, this feature is disabled by default. See Persistent connections for details.

*Model.save() algorithm changed*

The Model.save() method now tries to directly UPDATE the database if the instance has a primary key value. Previously SELECT was performed to determine if UPDATE or INSERT were needed. The new algorithm needs only one query for updating an existing row while the old algorithm needed two. See Model.save() for more details.

In some rare cases the database doesn’t report that a matching row was found when doing an UPDATE. An example is the PostgreSQL ON UPDATE trigger which returns NULL. In such cases it is possible to set django.db.models.Options.select_on_save flag to force saving to use the old algorithm.



5 years ago
Depends on: 975516

Comment 2

5 years ago
I submitted a pull request to make django-tidings compatible:

Comment 3

5 years ago
There is a django bug in 1.6.1 that affects us: https://code.djangoproject.com/ticket/21882

It's fixed in stable/1.6.x but it hasn't been released. So we can either ship with that branch of django or wait for 1.6.2.

Comment 4

5 years ago
(In reply to Ricky Rosario [:rrosario, :r1cky] from comment #3)
> It's fixed in stable/1.6.x but it hasn't been released.

Hmm, maybe it's a different issue because I still get this traceback with stable/1.6.x:

  vi +31  kitsune/search/tests/test_views.py  # test_discussion_forum_with_restricted_forums
    response = self.client.get(reverse('search'), {'a': '2'})
  vi +473 vendor/src/django/django/test/client.py  # get
    response = super(Client, self).get(path, data=data, **extra)
  vi +280 vendor/src/django/django/test/client.py  # get
    return self.request(**r)
  vi +71  kitsune/sumo/tests/__init__.py  # request
    return super(LocalizingClient, self).request(**request)
  vi +426 vendor/src/django/django/test/client.py  # request
    response = self.handler(environ)
  vi +109 vendor/src/django/django/test/client.py  # __call__
    response = self.get_response(request)
  vi +196 vendor/src/django/django/core/handlers/base.py  # get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  vi +114 vendor/src/django/django/core/handlers/base.py  # get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  vi +23  vendor/src/django-mobility/mobility/decorators.py  # wrapper
    return f(request, *args, **kw)
  vi +113 kitsune/search/views.py  # search
    'search_form': search_form})
  vi +53  vendor/src/django/django/shortcuts/__init__.py  # render
    return HttpResponse(loader.render_to_string(*args, **kwargs),
  vi +169 vendor/src/django/django/template/loader.py  # render_to_string
    return t.render(context_instance)
  vi +193 vendor/src/jingo/jingo/__init__.py  # render
    return super(Template, self).render(context_dict)
  vi +49  vendor/src/test-utils/test_utils/__init__.py  # instrumented_render
    return old_render(self, *args, **kwargs)
  vi +891 /Users/rlr/.virtualenvs/kitsune/lib/python2.7/site-packages/jinja2/environment.py  # render
    return self.environment.handle_exception(exc_info, True)
  vi +5   kitsune/search/templates/search/form.html  # top-level template code
    {% set classes = 'advanced_search' %}
  vi +12  kitsune/search/templates/search/base.html  # top-level template code
    {% set hide_header_search = True %}
  vi +178 kitsune/sumo/templates/base.html  # top-level template code
    {% block content %}{% endblock %}
  vi +31  kitsune/search/templates/search/form.html  # block "content"
    {{ search_form.language.label_tag() }}
  vi +530 vendor/src/django/django/forms/forms.py  # label_tag
    if label_suffix and contents and contents[-1] not in _(':?.!'):
  vi +129 vendor/src/django/django/utils/functional.py  # __wrapper__
    raise TypeError("Lazy object returned unexpected type.")
TypeError: Lazy object returned unexpected type.

Enough for today... But I am down to that 10 of those errors with the other fixes submitted.

1529 tests, 0 failures, 10 errors, 5 skips in 219.0s


5 years ago
Depends on: 984401

Comment 5

5 years ago
I'd like to spend 3 pts on this in next sprint to see if we can get it done this quarter.
Assignee: nobody → rrosario
Whiteboard: u=dev c=general p=3 s=2014.6

Comment 6

5 years ago
In a pull request:

If it sticks, I'll drop this a pt or two.

Comment 7

5 years ago
Landed a bunch of commit son master:

If travis is happy, we'll deploy to stage and do some testing. Then decide if we go to prod today or next week.

Comment 9

5 years ago
This is on prod and has been looking great for 10+ minutes.
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.