소스 검색

Drop support for Django 1.5

Oscar's policy is to support two versions of Django. So while there
isn't a major reason to drop support for Django 1.5, dropping support
for Django 1.6 once 1.8 is released will reduce complexity considerably.
master
Maik Hoepfel 11 년 전
부모
커밋
d131cfc15a
7개의 변경된 파일26개의 추가작업 그리고 58개의 파일을 삭제
  1. 1
    2
      .travis.yml
  2. 2
    1
      docs/source/releases/v0.8.rst
  3. 12
    22
      oscar/app.py
  4. 0
    4
      oscar/apps/catalogue/managers.py
  5. 6
    9
      oscar/apps/customer/utils.py
  6. 1
    1
      setup.py
  7. 4
    19
      tox.ini

+ 1
- 2
.travis.yml 파일 보기

10
     # $TRANSIFEX_PASSWORD for oscar_bot (used in transifex.sh)
10
     # $TRANSIFEX_PASSWORD for oscar_bot (used in transifex.sh)
11
     secure: FuIlzEsGJiAwhaIRBmRNsq9eXmuzs25fX6BChknW4lDyVAySWMp0+Zps9Bd0JgfFYUG3Ip+OTmksYIoTUsG25ZJS9cq1IFt3QKUAN70YCI/4ZBLeIdICPEyxq+Km179+NeEXmBUug17RLMLxh3MWfO+RKUHK9yHIPNNpq0dNyoo=
11
     secure: FuIlzEsGJiAwhaIRBmRNsq9eXmuzs25fX6BChknW4lDyVAySWMp0+Zps9Bd0JgfFYUG3Ip+OTmksYIoTUsG25ZJS9cq1IFt3QKUAN70YCI/4ZBLeIdICPEyxq+Km179+NeEXmBUug17RLMLxh3MWfO+RKUHK9yHIPNNpq0dNyoo=
12
   matrix:
12
   matrix:
13
-    - DJANGO_VERSION=1.5.8
14
     - DJANGO_VERSION=1.6.5
13
     - DJANGO_VERSION=1.6.5
15
-    - DJANGO_VERSION=https://www.djangoproject.com/download/1.7c1/tarball/
14
+    - DJANGO_VERSION=https://github.com/django/django/archive/2c6ef625ad73c38769f086733356e37a938b69c3.zip
16
 
15
 
17
 matrix:
16
 matrix:
18
   allow_failures:
17
   allow_failures:

+ 2
- 1
docs/source/releases/v0.8.rst 파일 보기

37
 Compatibility
37
 Compatibility
38
 -------------
38
 -------------
39
 
39
 
40
-Oscar 0.8 is compatible with Django 1.5-1.7. 
40
+Oscar 0.8 drops supports for Django 1.5, and is compatible with Django 1.6 and
41
+Django 1.7.
41
 
42
 
42
 Support for Python 2.6 has been dropped; Oscar works with Python 2.7, 3.3
43
 Support for Python 2.6 has been dropped; Oscar works with Python 2.7, 3.3
43
 and 3.4.
44
 and 3.4.

+ 12
- 22
oscar/app.py 파일 보기

48
                 login_forbidden(auth_views.password_reset_done),
48
                 login_forbidden(auth_views.password_reset_done),
49
                 name='password-reset-done')]
49
                 name='password-reset-done')]
50
 
50
 
51
-        # Django <=1.5: uses uidb36 to encode the user's primary key
51
+        # Django <=1.5: uses uidb36 to encode the user's primary key (support has been removed)
52
         # Django 1.6:   uses uidb64 to encode the user's primary key, but
52
         # Django 1.6:   uses uidb64 to encode the user's primary key, but
53
         #               but supports legacy links
53
         #               but supports legacy links
54
         # Django > 1.7: used uidb64 to encode the user's primary key
54
         # Django > 1.7: used uidb64 to encode the user's primary key
55
         # see https://docs.djangoproject.com/en/dev/releases/1.6/#django-contrib-auth-password-reset-uses-base-64-encoding-of-user-pk
55
         # see https://docs.djangoproject.com/en/dev/releases/1.6/#django-contrib-auth-password-reset-uses-base-64-encoding-of-user-pk
56
-        if django.VERSION < (1, 6):
56
+        urls.append(
57
+            url(r'^password-reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
58
+                login_forbidden(auth_views.password_reset_confirm),
59
+                {
60
+                    'post_reset_redirect': reverse_lazy('password-reset-complete'),
61
+                    'set_password_form': self.set_password_form,
62
+                },
63
+                name='password-reset-confirm'))
64
+        if django.VERSION < (1, 7):
57
             urls.append(
65
             urls.append(
58
                 url(r'^password-reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
66
                 url(r'^password-reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
59
-                    login_forbidden(auth_views.password_reset_confirm),
67
+                    login_forbidden(auth_views.password_reset_confirm_uidb36),
60
                     {
68
                     {
61
                         'post_reset_redirect': reverse_lazy('password-reset-complete'),
69
                         'post_reset_redirect': reverse_lazy('password-reset-complete'),
62
                         'set_password_form': self.set_password_form,
70
                         'set_password_form': self.set_password_form,
63
-                    },
64
-                    name='password-reset-confirm'))
65
-        else:
66
-            urls.append(
67
-                url(r'^password-reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
68
-                    login_forbidden(auth_views.password_reset_confirm),
69
-                    {
70
-                        'post_reset_redirect': reverse_lazy('password-reset-complete'),
71
-                        'set_password_form': self.set_password_form,
72
-                    },
73
-                    name='password-reset-confirm'))
74
-            if django.VERSION < (1, 7):
75
-                urls.append(
76
-                    url(r'^password-reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
77
-                        login_forbidden(auth_views.password_reset_confirm_uidb36),
78
-                        {
79
-                            'post_reset_redirect': reverse_lazy('password-reset-complete'),
80
-                            'set_password_form': self.set_password_form,
81
-                        }))
71
+                    }))
82
 
72
 
83
         urls += [
73
         urls += [
84
             url(r'^password-reset/complete/$',
74
             url(r'^password-reset/complete/$',

+ 0
- 4
oscar/apps/catalogue/managers.py 파일 보기

40
     def base_queryset(self):
40
     def base_queryset(self):
41
         return self.get_queryset().base_queryset()
41
         return self.get_queryset().base_queryset()
42
 
42
 
43
-    get_query_set = get_queryset  # Django 1.5 compatibility fix
44
-
45
 
43
 
46
 class BrowsableProductManager(ProductManager):
44
 class BrowsableProductManager(ProductManager):
47
     """
45
     """
52
 
50
 
53
     def get_queryset(self):
51
     def get_queryset(self):
54
         return super(BrowsableProductManager, self).get_queryset().browsable()
52
         return super(BrowsableProductManager, self).get_queryset().browsable()
55
-
56
-    get_query_set = get_queryset  # Django 1.5 compatibility fix

+ 6
- 9
oscar/apps/customer/utils.py 파일 보기

1
 import logging
1
 import logging
2
 
2
 
3
-import django
4
 from django.core.mail import EmailMessage, EmailMultiAlternatives
3
 from django.core.mail import EmailMessage, EmailMultiAlternatives
5
 from django.core.urlresolvers import reverse
4
 from django.core.urlresolvers import reverse
6
 from django.conf import settings
5
 from django.conf import settings
7
 from django.contrib.auth.tokens import default_token_generator
6
 from django.contrib.auth.tokens import default_token_generator
7
+from django.utils.http import urlsafe_base64_encode
8
+from django.utils.encoding import force_bytes
8
 
9
 
9
 from oscar.core.loading import get_model
10
 from oscar.core.loading import get_model
10
 
11
 
111
     """
112
     """
112
     Generate a password-reset URL for a given user
113
     Generate a password-reset URL for a given user
113
     """
114
     """
114
-    kwargs = {'token': token_generator.make_token(user)}
115
-    if django.VERSION < (1, 6):
116
-        from django.utils.http import int_to_base36
117
-        kwargs['uidb36'] = int_to_base36(user.id)
118
-    else:
119
-        from django.utils.http import urlsafe_base64_encode
120
-        from django.utils.encoding import force_bytes
121
-        kwargs['uidb64'] = urlsafe_base64_encode(force_bytes(user.id))
115
+    kwargs = {
116
+        'token': token_generator.make_token(user),
117
+        'uidb64': urlsafe_base64_encode(force_bytes(user.id)),
118
+    }
122
     return reverse('password-reset-confirm', kwargs=kwargs)
119
     return reverse('password-reset-confirm', kwargs=kwargs)
123
 
120
 
124
 
121
 

+ 1
- 1
setup.py 파일 보기

35
       packages=find_packages(exclude=["sandbox*", "tests*"]),
35
       packages=find_packages(exclude=["sandbox*", "tests*"]),
36
       include_package_data=True,
36
       include_package_data=True,
37
       install_requires=[
37
       install_requires=[
38
-          'django>=1.5.7,<1.8',
38
+          'django>=1.6.5,<1.8',
39
           # PIL is required for image fields, Pillow is the "friendly" PIL fork
39
           # PIL is required for image fields, Pillow is the "friendly" PIL fork
40
           'pillow>=1.7.8,<2.5',
40
           'pillow>=1.7.8,<2.5',
41
           # Oscar ships with migrations
41
           # Oscar ships with migrations

+ 4
- 19
tox.ini 파일 보기

8
 max-complexity = 10
8
 max-complexity = 10
9
 
9
 
10
 [tox]
10
 [tox]
11
-envlist = py27-1.5, py27-1.6, py33-1.5, py33-1.6, py34-1.5, py34-1.6
11
+envlist = py27-1.6, py27-1.7, py33-1.6, py33-1.7, py34-1.6, py34-1.7
12
 
12
 
13
 [testenv]
13
 [testenv]
14
 commands = python runtests.py []
14
 commands = python runtests.py []
15
 
15
 
16
-[testenv:py27-1.5]
17
-basepython = python2.7
18
-deps = -r{toxinidir}/requirements_py2.txt
19
-       django==1.5.8
20
-
21
-[testenv:py33-1.5]
22
-basepython = python3.3
23
-deps = -r{toxinidir}/requirements.txt
24
-       django==1.5.8
25
-
26
-[testenv:py34-1.5]
27
-basepython = python3.4
28
-deps = -r{toxinidir}/requirements.txt
29
-       django==1.5.8
30
-
31
 [testenv:py27-1.6]
16
 [testenv:py27-1.6]
32
 basepython = python2.7
17
 basepython = python2.7
33
 deps = -r{toxinidir}/requirements_py2.txt
18
 deps = -r{toxinidir}/requirements_py2.txt
46
 [testenv:py27-1.7]
31
 [testenv:py27-1.7]
47
 basepython = python2.7
32
 basepython = python2.7
48
 deps = -r{toxinidir}/requirements_py2.txt
33
 deps = -r{toxinidir}/requirements_py2.txt
49
-       https://www.djangoproject.com/download/1.7c1/tarball/
34
+       https://github.com/django/django/archive/2c6ef625ad73c38769f086733356e37a938b69c3.zip
50
 
35
 
51
 [testenv:py33-1.7]
36
 [testenv:py33-1.7]
52
 basepython = python3.3
37
 basepython = python3.3
53
 deps = -r{toxinidir}/requirements.txt
38
 deps = -r{toxinidir}/requirements.txt
54
-       https://www.djangoproject.com/download/1.7c1/tarball/
39
+       https://github.com/django/django/archive/2c6ef625ad73c38769f086733356e37a938b69c3.zip
55
 
40
 
56
 [testenv:py34-1.7]
41
 [testenv:py34-1.7]
57
 basepython = python3.4
42
 basepython = python3.4
58
 deps = -r{toxinidir}/requirements.txt
43
 deps = -r{toxinidir}/requirements.txt
59
-       https://www.djangoproject.com/download/1.7c1/tarball/
44
+       https://github.com/django/django/archive/2c6ef625ad73c38769f086733356e37a938b69c3.zip

Loading…
취소
저장