File: django1.6compat.patch

package info (click to toggle)
django-openid-auth 0.5-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 364 kB
  • ctags: 324
  • sloc: python: 2,221; makefile: 21
file content (91 lines) | stat: -rw-r--r-- 3,785 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Origin: commit, revision id: a.starr.b@gmail.com-20140222170700-oft8zromsl5bw5hx
Author: Andrew Starr-Bochicchio <a.starr.b@gmail.com>
Bug: https://launchpad.net/bugs/1252866
Bug: https://launchpad.net/bugs/1252445
Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=729828
Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739617
Forwarded: https://code.launchpad.net/~andrewsomething/django-openid-auth/1252445/+merge/195793
Last-Update: 2014-02-22
X-Bzr-Revision-Id: a.starr.b@gmail.com-20140222170700-oft8zromsl5bw5hx
Description: Fix compatibility issues with Django 1.6.

=== modified file 'django_openid_auth/tests/urls.py'
--- old/django_openid_auth/tests/urls.py	2013-03-13 21:55:40 +0000
+++ new/django_openid_auth/tests/urls.py	2014-02-22 16:58:08 +0000
@@ -27,7 +27,7 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 from django.http import HttpResponse
-from django.conf.urls.defaults import *
+from django.conf.urls import *
 
 
 def get_user(request):

=== modified file 'django_openid_auth/urls.py'
--- old/django_openid_auth/urls.py	2013-03-13 21:55:40 +0000
+++ new/django_openid_auth/urls.py	2014-02-22 16:58:08 +0000
@@ -27,7 +27,7 @@
 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-from django.conf.urls.defaults import *
+from django.conf.urls import *
 
 urlpatterns = patterns('django_openid_auth.views',
     url(r'^login/$', 'login_begin', name='openid-login'),

=== modified file 'example_consumer/manage.py'
--- old/example_consumer/manage.py	2007-05-28 09:01:41 +0000
+++ new/example_consumer/manage.py	2013-11-19 14:44:21 +0000
@@ -1,11 +1,15 @@
 #!/usr/bin/env python
-from django.core.management import execute_manager
-try:
-    import settings # Assumed to be in the same directory.
-except ImportError:
-    import sys
-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
-    sys.exit(1)
+import os
+import sys
+
+from django.core.management import execute_from_command_line
 
 if __name__ == "__main__":
-    execute_manager(settings)
+    try:
+        import settings # Assumed to be in the same directory.
+        os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+    except ImportError:
+        sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+        sys.exit(1)
+
+    execute_from_command_line(sys.argv)

=== modified file 'example_consumer/settings.py'
--- old/example_consumer/settings.py	2013-07-19 18:54:31 +0000
+++ new/example_consumer/settings.py	2014-02-22 17:07:00 +0000
@@ -152,3 +152,8 @@
 
 # Should django_auth_openid be used to sign into the admin interface?
 OPENID_USE_AS_ADMIN_LOGIN = False
+
+# Temporarily modify the session serializer because the json serializer in
+# Django 1.6 can't serialize openid.yadis.manager.YadisServiceManager objects.
+# See LP: #1252826
+SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'

=== modified file 'example_consumer/urls.py'
--- old/example_consumer/urls.py	2013-03-13 21:55:40 +0000
+++ new/example_consumer/urls.py	2014-02-22 16:58:08 +0000
@@ -27,7 +27,7 @@
 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-from django.conf.urls.defaults import *
+from django.conf.urls import *
 from django.contrib import admin
 
 import views