Django 1.6 Update Notes
Default session serialization switched to JSON
Django changed the way the session variable is being stored from pickle to JSON. This is for the best as there is an exploit if the attacker knows your SECRET_KEY and has access to the CSRF tokens being sent by users and the session variable uses pickle. Using JSON fixes this and Django has elected to make it the new default. The issue is that some things, in our case timezones, are not JSON serializable. If you'd like to still use pickle for your session variables just addSESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' to your settings.py file.
Simplejson Deprecated
Simplejson has been deprecated and you should now use JSON. This means you'll need to change your imports fromfrom django.utils import simplejson to just import json and you'll need to change any code that uses simplejson to just json.
User Profile Deprecated
They 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.settings.py
AUTH_USER_MODEL = 'myapp.CustomUser'
models.py
from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser):
keyboard_shortcuts = models.BooleanField(default=True)
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.
models.py
from django.conf import settings
class SomeData(models.Model):
\ ....
\ user = models.ForeignKey(settings.AUTH_USER_MODEL)
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.
Comments
Join the discussionNo comments yet. Be the first to comment.




