Last active
August 29, 2015 14:24
-
-
Save armicron/cf47df570014da6ce6f3 to your computer and use it in GitHub Desktop.
upgrading django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) (Backward compatible) Django 1.8 get_current_site RequestSite support | |
https://github.com/pennersr/django-allauth/commit/1a25ea96efcb969945df53be220bb65d75ef50db | |
2) simplejson compatibility | |
try: | |
from django.utils import simplejson | |
except ImportError: | |
import json as simplejson | |
3) try: | |
from django.contrib.sites.requests import RequestSite | |
except ImportError: | |
# Django < 1.7 | |
from django.contrib.sites.models import RequestSite | |
4) try: | |
from django.apps import apps | |
get_model = apps.get_model | |
except ImportError: | |
# Django < 1.7 | |
from django.db.models import loading | |
get_model = loading.get_model | |
https://github.com/macropin/django-registration/blob/9e27a77f4a47c98cdd404207a983b3831d0781db/registration/compat.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment