Django 1.6 Update Notes
Django finally released version 1.6 of their Python based web-framework. I use it at my job everyday and we ran into issues with the old system where they were using such an old version of Django that it was impossible to just simply update. One of the goals with the new system we are creating is to stay as up to date as we possibly can with all of our technologies. For us that is Bootstrap, jQuery, Django, and a few other third-party web plugins. Here are a few of the notes I'm writing down for myself and for others to use if they run into issues in upgrading from 1.5.4 to 1.6.
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'to your
Simplejson DeprecatedSimplejson has been deprecated and you should now use JSON. This means you'll need to change your imports from
from django.utils import simplejsonto just
import jsonand you'll need to change any code that uses simplejson to just json.
User Profile DeprecatedThey have officially deprecated the use of user profiles attached to the default user in favor of custom user models. Custom user models should be setup on initial project creation. If you didn't do this then you can use something like South to migrate your data. The easiest way to create a custom user model is shown below by extending the base Django user and just adding to it.
AUTH_USER_MODEL = 'myapp.CustomUser'
Now anywhere you would make a foreign key to User you'll need to import settings and use settings.AUTH_USER_MODEL instead of User.
from django.contrib.auth.models import AbstractUser class CustomUser(AbstractUser): keyboard_shortcuts = models.BooleanField(default=True)
Those are all of the major things that I needed to change to update everything. Granted they started to deprecate user profiles back in 1.5 we just hadn't made the change yet and needed to now. Hope this helps and if you find any other bugs or awkwardness when upgrading post in the comments below. You can also read the Django 1.6 release notes on their site.
from django.conf import settings class SomeData(models.Model): \ .... \ user = models.ForeignKey(settings.AUTH_USER_MODEL)